]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
PyParser_ParseString(): When the err_ret structure is initialized, the
authorBarry Warsaw <barry@python.org>
Fri, 18 Aug 2000 05:04:08 +0000 (05:04 +0000)
committerBarry Warsaw <barry@python.org>
Fri, 18 Aug 2000 05:04:08 +0000 (05:04 +0000)
fields token and expected must also be initialized, otherwise the
tests in parsetok() can generate uninitialized memory read errors.
This quiets an Insure warning.

Parser/parsetok.c

index 24bda836c504106d37194e9326016655a1eee84d..5f51f6adbdb6e95828caa292cab409433633723f 100644 (file)
@@ -36,6 +36,8 @@ PyParser_ParseString(char *s, grammar *g, int start, perrdetail *err_ret)
        err_ret->lineno = 0;
        err_ret->offset = 0;
        err_ret->text = NULL;
+       err_ret->token = -1;
+       err_ret->expected = -1;
 
        if ((tok = PyTokenizer_FromString(s)) == NULL) {
                err_ret->error = E_NOMEM;