From 4098df4427626105db2ea850f70b5242c1b517a3 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Thu, 21 Mar 2024 11:23:43 -0400 Subject: [PATCH] Fix compile warning regarding unecessary right shift No point shifting a 16bit variable more than 16 bits. --- libclamav/ole2_extract.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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++] = '_'; }