mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
libvmdump: Increase message buffer size
The message buffer of DumpException doesn't account for additional
strings such as strerror(), device nodes, or filenames. Make it a bit
larger to be safe.
This fixes the following GCC8 compile warnings:
In file included from vm_dump.h:62,
from vm_dump.cpp:17:
dump.h: In static member function ‘static Dump::DumpType
VMDump::getDumpType(const char*)’:
dump.h:46:16: warning: ‘ (’ directive writing 2 bytes into a region of size
between 1 and 200 [-W format-overflow=]
sprintf(msg, "%s (%s)", m, strerror(errno));
^~~~~~~~~
dump.h:46:10: note: ‘sprintf’ output 4 or more bytes (assuming 203) into a
destination of size 200
sprintf(msg, "%s (%s)", m, strerror(errno));
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dump.h:46:16: warning: ‘ (’ directive writing 2 bytes into a region of size
between 1 and 200 [-W format-overflow=]
sprintf(msg, "%s (%s)", m, strerror(errno));
^~~~~~~~~
dump.h:46:10: note: ‘sprintf’ output 4 or more bytes (assuming 203) into a
destination of size 200
sprintf(msg, "%s (%s)", m, strerror(errno));
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dump.h:46:16: warning: ‘ (’ directive writing 2 bytes into a region of size
between 1 and 200 [-W format-overflow=]
sprintf(msg, "%s (%s)", m, strerror(errno));
^~~~~~~~~
dump.h:46:10: note: ‘sprintf’ output 4 or more bytes (assuming 203) into a
destination of size 200
sprintf(msg, "%s (%s)", m, strerror(errno));
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -35,7 +35,7 @@ public:
|
||||
const char *what(void) const { return msg; }
|
||||
int code(void) const { return errorCode; }
|
||||
protected:
|
||||
char msg[200];
|
||||
char msg[2048];
|
||||
int errorCode;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user