Merge branch 'maint'
* maint: use xmemdupz() to allocate copies of strings given by start and length use xcalloc() to allocate zero-initialized memory
This commit is contained in:
@ -2867,9 +2867,7 @@ static int apply_binary_fragment(struct image *img, struct patch *patch)
|
||||
case BINARY_LITERAL_DEFLATED:
|
||||
clear_image(img);
|
||||
img->len = fragment->size;
|
||||
img->buf = xmalloc(img->len+1);
|
||||
memcpy(img->buf, fragment->patch, img->len);
|
||||
img->buf[img->len] = '\0';
|
||||
img->buf = xmemdupz(fragment->patch, img->len);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user