-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Open
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
for i in range(21):
try:
offset = nti(buf[pos:pos + 12])
numbytes = nti(buf[pos + 12:pos + 24])
except ValueError:
break
if offset and numbytes:
structs.append((offset, numbytes))
pos += 24
Line 1441 in 7040aa5
if offset and numbytes: |
- There is no check that offset or numbytes are non-negative.
- The check if offset and numbytes: only skips zero, not negative numbers.
validation should be added:
if offset >= 0 and numbytes >= 0:
structs.append((offset, numbytes))
- This will prevent the addition of invalid sparse mappings, mitigating the risk.
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
No status