Przeglądaj źródła

Fix uninitialized variable in cpu usage reporting

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 lat temu
rodzic
commit
54284eac62
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10 0
      system/jlib/jdebug.cpp

+ 10 - 0
system/jlib/jdebug.cpp

@@ -1605,8 +1605,18 @@ public:
         kbuf = NULL;
         kbuf = NULL;
         kbufsz = 0;
         kbufsz = 0;
         kbufcrc = 0;
         kbufcrc = 0;
+        memset(&oldcpu, 0, sizeof(oldcpu));
+        memset(&newcpu, 0, sizeof(newcpu));
+        memset(&cpu, 0, sizeof(cpu));
+        totalcpu = 0;
+        numcpu = 0;
+        memset(&oldnet, 0, sizeof(oldnet));
+        memset(&newnet, 0, sizeof(newnet));
+        ndisks = 0;
         if (printklog)
         if (printklog)
             kbufmax = 0x1000;
             kbufmax = 0x1000;
+        else
+            kbufmax = 0;
     }
     }
 
 
     ~CExtendedStats()
     ~CExtendedStats()