Whole file
vivisect/vivisect
The author described this change as “fix bug in readMemString(<>, wide=True) where the last \x00 is considered part of the terminator instead of the last character (#663)”. It counts as a record because the check below fails on the code as it stood at 4729907d9 and passes on e29a86b48, with nothing else changed between the two runs.
Projectvivisect/vivisect
Fix saved2024-08-19
Sharing licenceApache-2.0 · LICENSE.txt
Change size+4 −0
What the code was meant to do, written into the code itself as a save note
fix bug in readMemString(<>, wide=True) where the last \x00 is considered part of the terminator instead of the last character (#663)
The change
| 739 | 739 | ||
| 740 | 740 | # now find the end of the string based on either \x00, maxlen, or end of map | |
| 741 | 741 | end = mbytes.find(terminator, offset) | |
| 742 | + | while (end > offset) and (end-offset) % len(terminator) != 0: | |
| 743 | + | # with codepage 0, we really need \0\0\0 because the first | |
| 744 | + | # 0 is part of the last character | |
| 745 | + | end = mbytes.find(terminator, end+1) | |
| 742 | 746 | ||
| 743 | 747 | left = end - offset | |
| 744 | 748 | if end == -1: |
The check that tells the two apart
fail→pass·envi/tests/test_memory.py::EnviMemoryTest::test_readMemString
Check file envi/tests/test_memory.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it4729907d987b4ca79c1e774dead0e6d3c285f150
Broken version dated2024-08-12
Moduleenvi.memory
Units changedMemoryObject
Fingerprintebfdce5cf56bc5b5
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in vivisect/vivisect
- 2021-04-06Visgraph bug older than dirt (#387)