mirror of
https://github.com/dynup/kpatch
synced 2025-04-26 04:57:58 +00:00
don't compare data on NOBITS sections
NOBITS section may have a non-zero size, however, the have no data and the data descriptor will have d_buf set to NULL. This commit fixes as segfault that occurs from trying to compare the data of such sections. Signed-off-by: Seth Jennings <sjenning@redhat.com>
This commit is contained in:
parent
d927215dda
commit
d32ca30052
@ -441,7 +441,8 @@ void kpatch_compare_correlated_section(struct section *sec)
|
||||
|
||||
if (sec1->sh.sh_size != sec2->sh.sh_size ||
|
||||
sec1->data->d_size != sec2->data->d_size ||
|
||||
memcmp(sec1->data->d_buf, sec2->data->d_buf, sec1->data->d_size))
|
||||
(sec1->sh.sh_type != SHT_NOBITS &&
|
||||
memcmp(sec1->data->d_buf, sec2->data->d_buf, sec1->data->d_size)))
|
||||
sec1->status = CHANGED;
|
||||
else
|
||||
sec1->status = SAME;
|
||||
|
Loading…
Reference in New Issue
Block a user