Explorar o código

Avoid accessing memory without initialization

oddcoder %!s(int64=4) %!d(string=hai) anos
pai
achega
d373bcb032
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      tests/error.c

+ 1 - 1
tests/error.c

@@ -20,7 +20,7 @@ int main(void) {
     int ret2 = strerror_r(err, buf2, 3);
     printf("errno: %d = %s, return: %d\n", err, buf2, ret2);
 
-    char buf3[256];
+    char buf3[256] = {0};
     int ret3 = strerror_r(err, buf3, 0);
     printf("errno: %d = %s, return: %d\n", err, buf3, ret3);
 }