if (chunks == NULL) {
goto bail;
}
+ if (end < 0 || len <= end) {
+ PyErr_SetString(PyExc_ValueError, "end is out of bounds");
+ goto bail;
+ }
while (1) {
/* Find the end of the string or the next escape */
Py_UNICODE c = 0;
break;
}
else if (strict && c <= 0x1f) {
- raise_errmsg("Invalid control character at", pystr, begin);
+ raise_errmsg("Invalid control character at", pystr, next);
goto bail;
}
}
if (chunks == NULL) {
goto bail;
}
+ if (end < 0 || len <= end) {
+ PyErr_SetString(PyExc_ValueError, "end is out of bounds");
+ goto bail;
+ }
while (1) {
/* Find the end of the string or the next escape */
Py_UNICODE c = 0;
break;
}
else if (strict && c <= 0x1f) {
- raise_errmsg("Invalid control character at", pystr, begin);
+ raise_errmsg("Invalid control character at", pystr, next);
goto bail;
}
}