Explorar o código

test.c: Fix buffer overrun found by coverity

Max Bruckner %!s(int64=8) %!d(string=hai) anos
pai
achega
c866abd842
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      test.c

+ 1 - 1
test.c

@@ -114,7 +114,7 @@ static int print_preallocated(cJSON *root)
     }
 
     /* create buffer to fail */
-    len_fail = strlen(out);
+    len_fail = strlen(out) + sizeof('\0');
     buf_fail = (char*)malloc(len_fail);
     if (buf_fail == NULL)
     {