diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-06-21 11:51:13 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-06-21 11:51:13 +0300 |
commit | 794b65d03c7274845badba291160f261fa2abf9e (patch) | |
tree | 0df7aaa9b6cff5c061290d5b32f69897331de3f4 | |
parent | 5f6d079dd752b25f29a37a34939951431c8ee43b (diff) | |
download | egawk-794b65d03c7274845badba291160f261fa2abf9e.tar.gz egawk-794b65d03c7274845badba291160f261fa2abf9e.tar.bz2 egawk-794b65d03c7274845badba291160f261fa2abf9e.zip |
Zero out buffers used to read source files.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | awkgram.c | 1 | ||||
-rw-r--r-- | awkgram.y | 1 |
3 files changed, 6 insertions, 0 deletions
@@ -1,6 +1,10 @@ 2019-06-21 Arnold D. Robbins <arnold@skeeve.com> * config.guess, config.sub: Updated from GNULIB. + * awkgram.y (get_src_buf): Set buffers to zero to avoid + possible issues with accessing uninitialized memory. + Thanks to valgrind, as pointed out by Nadezhda Vyukova + <qniva@yandex.ru>. 2019-06-19 Arnold D. Robbins <arnold@skeeve.com> @@ -5682,6 +5682,7 @@ get_src_buf() sourcefile->bufsize = l; newfile = true; emalloc(sourcefile->buf, char *, sourcefile->bufsize, "get_src_buf"); + memset(sourcefile->buf, '\0', sourcefile->bufsize); // keep valgrind happy lexptr = lexptr_begin = lexeme = sourcefile->buf; savelen = 0; sourceline = 1; @@ -3185,6 +3185,7 @@ get_src_buf() sourcefile->bufsize = l; newfile = true; emalloc(sourcefile->buf, char *, sourcefile->bufsize, "get_src_buf"); + memset(sourcefile->buf, '\0', sourcefile->bufsize); // keep valgrind happy lexptr = lexptr_begin = lexeme = sourcefile->buf; savelen = 0; sourceline = 1; |