From f2d6752901f2f2d8612fb43e10061570c9198af1 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 10 Feb 2022 21:02:16 +0100 Subject: [PATCH] blob: clear buf->head when freeing a buffer Prevents accidental silent use-after-free bugs Signed-off-by: Felix Fietkau --- blob.c | 1 + 1 file changed, 1 insertion(+) diff --git a/blob.c b/blob.c index bd66d78..65adb13 100644 --- a/blob.c +++ b/blob.c @@ -105,6 +105,7 @@ blob_buf_free(struct blob_buf *buf) { free(buf->buf); buf->buf = NULL; + buf->head = NULL; buf->buflen = 0; }