From d6d494e7b603a984ce18b110c35b6fe468537407 Mon Sep 17 00:00:00 2001 From: Karsten Heimrich Date: Tue, 7 Oct 2008 21:47:46 +0000 Subject: [PATCH] * The size of the array passed should was not enough to hold the entire formatted string. This fixes ticket #2802. (Not sure why it only happend on gcc4) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27914 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/hey.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/hey.cpp b/src/bin/hey.cpp index 2f7c67800a..07962909c5 100644 --- a/src/bin/hey.cpp +++ b/src/bin/hey.cpp @@ -1338,7 +1338,7 @@ format_data(int32 type, char *ptr, long size) } for (int32 i = 0; i < 10 && pinfo[pinfo_index].types[i] != 0; i++) { uint32 type = pinfo[pinfo_index].types[i]; - char str2[4]; + char str2[6]; sprintf(str2, "%c%c%c%c ", int(type & 0xFF000000) >> 24, int(type & 0xFF0000) >> 16, int(type & 0xFF00) >> 8, (int)type & 0xFF); strcat(str, str2); @@ -1347,7 +1347,7 @@ format_data(int32 type, char *ptr, long size) for (int32 i = 0; i < 3; i++) { for (int32 j = 0; j < 5 && pinfo[pinfo_index].ctypes[i].pairs[j].type != 0; j++) { uint32 type = pinfo[pinfo_index].ctypes[i].pairs[j].type; - char str2[4]; + char str2[strlen(pinfo[pinfo_index].ctypes[i].pairs[j].name) + 8]; sprintf(str2, "(%s %c%c%c%c)", pinfo[pinfo_index].ctypes[i].pairs[j].name, int(type & 0xFF000000) >> 24, int(type & 0xFF0000) >> 16,