mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-03 04:05:06 +00:00
Enforce size in section.findMatching
This commit is contained in:
parent
a93ecf2b69
commit
4c4bfd11c2
@ -30,14 +30,20 @@ R_API RIOSection *r_io_section_get_name(RIO *io, const char *name) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// update name and rwx, size is experimental
|
||||
static RIOSection *findMatching (RIO *io, ut64 paddr, ut64 vaddr, ut64 size, ut64 vsize, int rwx, const char *name) {
|
||||
RListIter *iter;
|
||||
RIOSection *s;
|
||||
r_list_foreach (io->sections, iter, s) {
|
||||
if (s->offset != paddr) continue;
|
||||
if (s->vaddr != vaddr) continue;
|
||||
#if 1
|
||||
if (s->size != size) continue;
|
||||
if (s->vsize != vsize) continue;
|
||||
#else
|
||||
s->size = size;
|
||||
s->vsize = vsize;
|
||||
#endif
|
||||
s->rwx = rwx;
|
||||
if (name && strcmp (name, s->name)) {
|
||||
strcpy (s->name, name); /// XXX overflow here
|
||||
|
Loading…
x
Reference in New Issue
Block a user