]> ocean-lang.org Git - ocean/commitdiff
parsergen: don't leave garbage in the $0 buffer.
authorNeilBrown <neil@brown.name>
Sat, 31 May 2014 10:14:53 +0000 (20:14 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 15 Jun 2014 07:20:50 +0000 (17:20 +1000)
As this is static it gets reused.  We are likely to free pointers
in it, so after doing that we should make sure it gets zeroed.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/parsergen.mdc

index 81121430f9b3e6e7c31c1c99aa656e1e3498c281..fbb561cfe7f2a796927474df4f08cad1225fda09 100644 (file)
@@ -2642,6 +2642,7 @@ since the last state which could have been at the start of a line.
 
                                pop(&p, size, do_free);
                                shift(&p, memdup(buf, bufsize), states);
+                               memset(buf, 0, bufsize);
                                if (prod == 0)
                                        accepted = 1;
                                continue;