Explorar el Código

Fuzz: Fix a warning for snprintf overrun

Julius Pfrommer hace 5 años
padre
commit
4ff617ffed
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      tests/fuzz/ua_debug_dump_pkgs_file.c

+ 2 - 2
tests/fuzz/ua_debug_dump_pkgs_file.c

@@ -175,12 +175,12 @@ UA_debug_dumpCompleteChunk(UA_Server *const server, UA_Connection *const connect
     snprintf(fileName, 255, "%s/%05d_%s%s", UA_CORPUS_OUTPUT_DIR, ++UA_dump_chunkCount,
              dump_filename.messageType ? dump_filename.messageType : "", dump_filename.serviceName);
 
-    char dumpOutputFile[255];
+    char dumpOutputFile[266];
     snprintf(dumpOutputFile, 255, "%s.bin", fileName);
     // check if file exists and if yes create a counting filename to avoid overwriting
     unsigned cnt = 1;
     while ( access( dumpOutputFile, F_OK ) != -1 ) {
-        snprintf(dumpOutputFile, 255, "%s_%d.bin", fileName, cnt);
+        snprintf(dumpOutputFile, 266, "%s_%d.bin", fileName, cnt);
         cnt++;
     }