Avoid a potential out of bound read access in debug code
This commit is contained in:
parent
3167cafd50
commit
c7e5f50504
1 changed files with 2 additions and 2 deletions
|
@ -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' && j<dir_entry->namsiz;j+=2)
|
||||
for(j=0;j<64 && j<dir_entry->namsiz && 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' && j<dir_entry->namsiz;j+=2)
|
||||
for(j=0;j<64 && j<dir_entry->namsiz && dir_entry->name[j]!='\0';j+=2)
|
||||
{
|
||||
log_info("%c",dir_entry->name[j]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue