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 <mjw@redhat.com>
+2015-05-30 Mark Wielaard <mjw@redhat.com>
+
+ * elf32_updatefile.c (updatemmap): Only call mempcpy and update
+ last_position when d_size is non-zero.
+
2015-05-17 Mark Wielaard <mjw@redhat.com>
* elf32_updatefile.c (updatefile): Allocate shdr_data and scns
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);