mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-17 18:07:55 +00:00
dfu: Fix a potential buffer overflow when applying a patch
This commit is contained in:
parent
572b7dbbd6
commit
d6df0040c3
@ -507,7 +507,7 @@ dfu_patch_apply (DfuPatch *self, GBytes *blob, DfuPatchApplyFlags flags, GError
|
|||||||
}
|
}
|
||||||
|
|
||||||
data_new = g_malloc0 (sz_max);
|
data_new = g_malloc0 (sz_max);
|
||||||
memcpy (data_new, data_old, sz_max);
|
memcpy (data_new, data_old, MIN (sz, sz_max));
|
||||||
for (guint i = 0; i < priv->chunks->len; i++) {
|
for (guint i = 0; i < priv->chunks->len; i++) {
|
||||||
DfuPatchChunk *chunk = g_ptr_array_index (priv->chunks, i);
|
DfuPatchChunk *chunk = g_ptr_array_index (priv->chunks, i);
|
||||||
const guint8 *chunk_data;
|
const guint8 *chunk_data;
|
||||||
|
Loading…
Reference in New Issue
Block a user