[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gforth] [bug #46988] Fix use of uninitalized memory

From: Bernd Paysan
Subject: [Bug-gforth] [bug #46988] Fix use of uninitalized memory
Date: Wed, 27 Jan 2016 17:55:32 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

Follow-up Comment #5, bug #46988 (project gforth):

Looks like the culprit is the relocate loop while symbol[i]!=0.  That last
zero doesn't get copied.  If I copy that last 0, valgrind reports nothing for

So I suggest to keep the malloc and correctly set the terminating 0 for the
allocated arrays.  That way we can check for unintended use of the
uninitialized part of the array.

Add the following before line 418 in engine/engine.c:

xts[i] = symbols[i] = 0;

and try if the bug persists (with the mallocs).


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]