Commit 77b8a94d authored by unknown's avatar unknown
Browse files

make the code to look safe, not only be safe

parent 3c45559d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
char *
strdup(const char *s){
  void *p2;
  p2 = malloc(strlen(s)+1);
  if ((p2 = malloc(strlen(s)+1)))
    strcpy(p2, s);
  return p2;
}
+2 −2
Original line number Diff line number Diff line
@@ -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;
  }