diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-02-10 21:02:16 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-02-10 21:02:20 +0100 |
commit | f2d6752901f2f2d8612fb43e10061570c9198af1 (patch) | |
tree | 1087eaf77ae2f5e25d58b4550608f6c65de7d15d | |
parent | cce5e351278b307af7f69931971e3d4e060117d7 (diff) | |
download | libubox-f2d6752901f2f2d8612fb43e10061570c9198af1.tar.gz |
blob: clear buf->head when freeing a buffer
Prevents accidental silent use-after-free bugs
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | blob.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -105,6 +105,7 @@ blob_buf_free(struct blob_buf *buf) { free(buf->buf); buf->buf = NULL; + buf->head = NULL; buf->buflen = 0; } |