format string did not match variable size -> stack corruption
authorAli Saidi <saidi@eecs.umich.edu>
Mon, 12 Sep 2005 20:09:51 +0000 (16:09 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Mon, 12 Sep 2005 20:09:51 +0000 (16:09 -0400)
--HG--
extra : convert_revision : b7c5aaa9d1f1242cfe337d6555e476f622a2aa6d

base/hostinfo.cc

index df9bd0d29c4d753bb9452b7bb8000957a3663d35..d15e3ddc13d657d9360562064f9b4562f449851a 100644 (file)
@@ -70,7 +70,7 @@ procInfo(char *filename, char *target)
     while (fp && !feof(fp) && !done) {
         if (fgets(line, 80, fp)) {
             if (strncmp(line, target, strlen(target)) == 0) {
-                snprintf(format, sizeof(format), "%s %%lld", target);
+                snprintf(format, sizeof(format), "%s %%ld", target);
                 sscanf(line, format, &usage);
 
                 fclose(fp);