Commit 77b8a94d authored by unknown's avatar unknown

make the code to look safe, not only be safe

parent 3c45559d
......@@ -21,8 +21,8 @@
char *
strdup(const char *s){
void *p2;
p2 = malloc(strlen(s)+1);
strcpy(p2, s);
if ((p2 = malloc(strlen(s)+1)))
strcpy(p2, s);
return p2;
}
#endif
......@@ -2247,9 +2247,9 @@ void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
DBUG_ENTER("print_buffer_to_nt_eventlog");
buffptr= buff;
if (length > (uint)(buffLen-4))
if (length > (uint)(buffLen-5))
{
char *newBuff= new char[length + 4];
char *newBuff= new char[length + 5];
strcpy(newBuff, buff);
buffptr= newBuff;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment