##// END OF EJS Templates
parsers: fix parse_dirstate to check len before unpacking header (issue4979)
Yuya Nishihara -
r27226:f5e8cb81 stable
parent child Browse files
Show More
@@ -493,6 +493,11 b' static PyObject *parse_dirstate(PyObject'
493
493
494 /* read filenames */
494 /* read filenames */
495 while (pos >= 40 && pos < len) {
495 while (pos >= 40 && pos < len) {
496 if (pos + 17 > len) {
497 PyErr_SetString(PyExc_ValueError,
498 "overflow in dirstate");
499 goto quit;
500 }
496 cur = str + pos;
501 cur = str + pos;
497 /* unpack header */
502 /* unpack header */
498 state = *cur;
503 state = *cur;
General Comments 0
You need to be logged in to leave comments. Login now