diff options
| author | Mark Wielaard <[email protected]> | 2015-05-30 23:43:11 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2015-06-05 14:44:59 +0200 |
| commit | b4ad3c4b81c57b36d9837dc81523cfa7950f30a7 (patch) | |
| tree | a453a08bb58408dc648ab7e78f33fbed9f139587 /libelf/elf32_updatefile.c | |
| parent | 5ad751b089896fbc5198485080eea5d1a8bd192b (diff) | |
libelf: Don't call mempcpy with possible NULL d_buf.
When d_size is zero d_buf might be NULL. last_position doesn't need to be
updated in that case.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libelf/elf32_updatefile.c')
| -rw-r--r-- | libelf/elf32_updatefile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libelf/elf32_updatefile.c b/libelf/elf32_updatefile.c index e90ad47d..913c3e46 100644 --- a/libelf/elf32_updatefile.c +++ b/libelf/elf32_updatefile.c @@ -367,7 +367,7 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum) last_position += dl->data.d.d_size; } - else + else if (dl->data.d.d_size != 0) last_position = mempcpy (last_position, dl->data.d.d_buf, dl->data.d.d_size); |
