From c7e5f5050412380f2c49a082ba9386133d674094 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Mon, 31 Oct 2011 17:51:32 +0100 Subject: [PATCH] Avoid a potential out of bound read access in debug code --- src/file_doc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file_doc.c b/src/file_doc.c index 7a35c093..c8a4fabb 100644 --- a/src/file_doc.c +++ b/src/file_doc.c @@ -212,7 +212,7 @@ static const char *ole_get_file_extension(const unsigned char *buffer, const uns { #ifdef DEBUG_OLE unsigned int j; - for(j=0;j<64 && dir_entry->name[j]!='\0' && jnamsiz;j+=2) + for(j=0;j<64 && jnamsiz && dir_entry->name[j]!='\0';j+=2) { log_info("%c",dir_entry->name[j]); } @@ -830,7 +830,7 @@ static void file_rename_doc(const char *old_filename) }; #ifdef DEBUG_OLE unsigned int j; - for(j=0;j<64 && dir_entry->name[j]!='\0' && jnamsiz;j+=2) + for(j=0;j<64 && jnamsiz && dir_entry->name[j]!='\0';j+=2) { log_info("%c",dir_entry->name[j]); }