Repository navigation
Conversation
__setitem__ carries __getitem__'s body: after the range check it returns the byte at the translated address instead of storing v there, so a write through a ClemoryView is silently lost.
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
Caveats: no code in |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS A write through a Before — the assignment is dropped and the byte keeps its old value: cle master 0e77adeAfter — the assignment reaches the underlying with this change |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_816 |
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
A write through a
ClemoryViewis silently lost.cleexports the class, and assigning abyte through one leaves the memory unchanged and reports no error:
Root cause
ClemoryView.__setitem__carries__getitem__'s body. After the range check it reads thebyte at the translated address and returns it, and
vis never used:Fix
Assign to the translated address instead of reading from it. The range check and the
KeyErrorit raises are unchanged.Nothing in
cle,angrorangr-managementconstructs aClemoryViewor subclasses one,so this has no in-tree caller today; the class is exported from
cleand the method is wrongfor anyone who does.
Testing
tests/test_clemory.pygainstest_clemory_view_setitem, which writes a byte through a viewand reads it back through the view, through the parent
Clemoryand throughClemory.load,and checks that an index outside the view still raises
KeyError. It fails on master withassert 65 == 90.Validation: #816 (comment)
session: sharpen