| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + Fix undefined behavior in parsetok.c. Patch by Zackery Spytz. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -225,7 +225,7 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret, | |||
| 225 | 225 | } | |
| 226 | 226 | else | |
| 227 | 227 | started = 1; | |
| 228 | - len = b - a; /* XXX this may compute NULL - NULL */ | ||
| 228 | + len = a != NULL && b != NULL ? b - a : 0; | ||
| 229 | 229 | str = (char *) PyObject_MALLOC(len + 1); | |
| 230 | 230 | if (str == NULL) { | |
| 231 | 231 | err_ret->error = E_NOMEM; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments