diff --git a/libclamav/ole2_extract.c b/libclamav/ole2_extract.c index 9a49a1e8b7..ca1a8f8dab 100644 --- a/libclamav/ole2_extract.c +++ b/libclamav/ole2_extract.c @@ -256,8 +256,8 @@ cli_ole2_get_property_name2(const char *name, int size) if ((name[0] == 0 && name[1] == 0) || size <= 0 || size > 128) { return NULL; } - CLI_MAX_MALLOC_OR_GOTO_DONE(newname, size * 7, - cli_errmsg("OLE2 [cli_ole2_get_property_name2]: Unable to allocate memory for newname: %u\n", size * 7)); + CLI_MAX_MALLOC_OR_GOTO_DONE(newname, size * 5, + cli_errmsg("OLE2 [cli_ole2_get_property_name2]: Unable to allocate memory for newname: %u\n", size * 5)); j = 0; /* size-2 to ignore trailing NULL */ @@ -275,8 +275,6 @@ cli_ole2_get_property_name2(const char *name, int size) newname[j++] = 'a' + ((x & 0xF)); newname[j++] = 'a' + ((x >> 4) & 0xF); newname[j++] = 'a' + ((x >> 8) & 0xF); - newname[j++] = 'a' + ((x >> 16) & 0xF); - newname[j++] = 'a' + ((x >> 24) & 0xF); } newname[j++] = '_'; }