Dr Memory Unitialized Read Error Disagrees With Dissasembly

1

I have a simple loop whose purpose is to split a line of a (very simple) csv into columns. The relevant section of the foor loop is as follows:

for (size_t i = 0; i< csvRowReader->_currentRowTextLength; i++)
{
    char character = csvRowReader->_currentRowText[i];

    if (character == ',') { ... }
    ...
}

Dr Memory reports the following uninitialized read:

Error #1: UNINITIALIZED READ: reading register eax
         CsvRowReader_MoveNext
             c:\users\holli\projects\transporter\source\csv\csvrowreader.c(116):
         ...

Now in an attempt to diagnose what was going on viewed the disassembly for that line of code:

   116:         if (character == ',')
00D4A40F  movsx       eax,byte ptr [ebp-35h]  
00D4A413  cmp         eax,2Ch  
00D4A416  jne         CsvRowReader_MoveNext+1F5h (0D4A545h) 

At 00D4A413 the register EAX has a value of EAX = 0000006E. Which is 'n':

(char)(0x0000006E)
110 'n'

So as far as I can tell eax is initialized with a value in this case 'n'. I am at my wits end trying to figure out what is causing this error, any any help be greatly appreciated!

c
dr-memory
asked on Stack Overflow Sep 6, 2015 by HennyH

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0