Skip to content

Commit

Permalink
pythongh-127740: Check if we had a second digit
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddy committed Dec 10, 2024
1 parent 82762db commit 6628ea7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Objects/bytesobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -2543,8 +2543,8 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray)

bot = _PyLong_DigitValue[*str];
if (bot >= 16) {
/* NULL at the end of the string */
if (bot == 37){
/* Check if we had a second digit */
if (str >= end){
invalid_char = -1;
} else {
invalid_char = str - PyUnicode_1BYTE_DATA(string);
Expand Down

0 comments on commit 6628ea7

Please sign in to comment.