]> granicus.if.org Git - procps-ng/commitdiff
library: fixing buffer sizes in sysinfo.c
authorJaromir Capik <jcapik@redhat.com>
Mon, 14 Jul 2014 17:07:25 +0000 (19:07 +0200)
committerJaromir Capik <jcapik@redhat.com>
Mon, 14 Jul 2014 17:07:25 +0000 (19:07 +0200)
proc/sysinfo.c

index e3e2ca5b45b3fc96104c2e9ba56f9bb495d7ffdf..92814df2fcc8c0f2d761b48c9e9199420aee9b50 100644 (file)
@@ -57,7 +57,8 @@ static int vminfo_fd = -1;
 
 // As of 2.6.24 /proc/meminfo seems to need 888 on 64-bit,
 // and would need 1258 if the obsolete fields were there.
-static char buf[2048];
+// As of 3.13 /proc/vmstat needs 2623 on 64-bit.
+static char buf[8192];
 
 /* This macro opens filename only if necessary and seeks to 0 so
  * that successive calls to the functions are more efficient.
@@ -748,7 +749,7 @@ static unsigned long vm_pginodesteal;         //
 static unsigned long vm_slabs_scanned;        //
 
 void vminfo(void){
-  char namebuf[16]; /* big enough to hold any row name */
+  char namebuf[32]; /* big enough to hold any row name */
   vm_table_struct findme = { namebuf, NULL};
   vm_table_struct *found;
   char *head;