File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2685,9 +2685,10 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray)
26852685 if (Py_ISSPACE (* str )) {
26862686 do {
26872687 str ++ ;
2688+ if (str >= end ) {
2689+ goto done ;
2690+ }
26882691 } while (Py_ISSPACE (* str ));
2689- if (str >= end )
2690- break ;
26912692 }
26922693
26932694 top = _PyLong_DigitValue [* str ];
@@ -2696,6 +2697,9 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray)
26962697 goto error ;
26972698 }
26982699 str ++ ;
2700+ if (str >= end ) {
2701+ break ;
2702+ }
26992703
27002704 bot = _PyLong_DigitValue [* str ];
27012705 if (bot >= 16 ) {
@@ -2712,6 +2716,7 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray)
27122716 * buf ++ = (unsigned char )((top << 4 ) + bot );
27132717 }
27142718
2719+ done :
27152720 if (view .obj != NULL ) {
27162721 PyBuffer_Release (& view );
27172722 }
You can’t perform that action at this time.
0 commit comments