Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79d96d6

Browse files
committed
Don't die in resizestring() on filter(<func>, "").
1 parent c13bcca commit 79d96d6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/bltinmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ filterstring(func, strobj)
17351735
GETSTRINGVALUE((stringobject *)item)[0];
17361736
}
17371737

1738-
if (resizestring(&result, j) < 0)
1738+
if (j < len && resizestring(&result, j) < 0)
17391739
return NULL;
17401740

17411741
return result;

0 commit comments

Comments
 (0)