Compilers do not terminate strings, library functions do. The most
common errors causing major problems in library functions are buffer
overflows. Assuming that library routines terminate strings and check
for buffer sizes is a common error which has made the task of security
crackers easy and caused other types of instability.
For years we have been deluged with patches to fix buffer overflow
vulnerabilities in commonly used software which should have been robust.
As they say, trust but verify.
Rich Rattanni wrote:
Just because you have a pointer assigned to the string does not ensure
that it is terminated. It only finds the start of the string. You need
a null character at the end.
I understand that John, but these strings I am writing to the database
are declared as follows...
const char message[] = "some message";
So the compiler will be null terminating these. Thats why I am
confused, it is no like I am building a string manually and forgetting
the \0 at the end.
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------