]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
S390: Buffer too small for large CPU numbers.
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Fri, 5 Oct 2012 13:59:08 +0000 (15:59 +0200)
committerEric Blake <eblake@redhat.com>
Fri, 5 Oct 2012 15:00:52 +0000 (09:00 -0600)
The output buffer for virFileReadAll was too small for systems with
more than 30 CPUs which leads to a log entry and incorrect behavior.
The new size will be sufficient for the current
architectural limits.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
src/util/sysinfo.c

index d38b4fff5301a16533951e1c28a2cba8d0a4fa09..8add936ea825c787f6e73df7fb887d0673740428 100644 (file)
@@ -361,7 +361,7 @@ virSysinfoRead(void) {
         goto no_memory;
 
     /* Gather info from /proc/cpuinfo */
-    if (virFileReadAll(CPUINFO, 2048, &outbuf) < 0) {
+    if (virFileReadAll(CPUINFO, 8192, &outbuf) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to open %s"), CPUINFO);
         return NULL;
@@ -376,7 +376,7 @@ virSysinfoRead(void) {
     VIR_FREE(outbuf);
 
     /* Gather info from /proc/sysinfo */
-    if (virFileReadAll(SYSINFO, 4096, &outbuf) < 0) {
+    if (virFileReadAll(SYSINFO, 8192, &outbuf) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to open %s"), SYSINFO);
         return NULL;