Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38aa14a

Browse files
committed
PyParser_ParseString(): When the err_ret structure is initialized, the
fields token and expected must also be initialized, otherwise the tests in parsetok() can generate uninitialized memory read errors. This quiets an Insure warning.
1 parent 5ca1ef9 commit 38aa14a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Parser/parsetok.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ PyParser_ParseString(char *s, grammar *g, int start, perrdetail *err_ret)
3636
err_ret->lineno = 0;
3737
err_ret->offset = 0;
3838
err_ret->text = NULL;
39+
err_ret->token = -1;
40+
err_ret->expected = -1;
3941

4042
if ((tok = PyTokenizer_FromString(s)) == NULL) {
4143
err_ret->error = E_NOMEM;

0 commit comments

Comments
 (0)