S
Susan Rice
How can I rewrite this code to avoid the possibility of a
buffer overflow?
sprintf(errbuf, "%s\nError is: %u: %s\n", errmsg, dwErrCode, s );
Here:
errmsg = a string
dwErrCode = a number
s = a string
I do have value 'errbuflen' = length of buffer 'errbuf'.
I'm just not using it.
Is there any easy way? Or is there only the hard way?
buffer overflow?
sprintf(errbuf, "%s\nError is: %u: %s\n", errmsg, dwErrCode, s );
Here:
errmsg = a string
dwErrCode = a number
s = a string
I do have value 'errbuflen' = length of buffer 'errbuf'.
I'm just not using it.
Is there any easy way? Or is there only the hard way?