You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The existing implementation of PyOS_mystricmp increments both pointers as long as the first string hasn't reached the end yet. If the second string ends first, then we increment past the null byte. If there is a difference in the middle of the two strings, then the result actually compares the following pair of letters.
e.g.
PyOS_mystricmp("a", "\0") => 0 (should be positive)
PyOS_mystricmp("foo", "fro") => 0 (should be negative)
Similarly, PyOS_mystrnicmp increments the pointers in a condition before breaking out of the loop. It's possible to increment the first pointer without incrementing the second, and the result is the character past the null byte.
e.g.
PyOS_mystrnicmp("\0a", "\0b", 2) => 97 (should be negative)
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: