From b83994dec7addcd5fecd0bfd2f734223eb0462f0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 27 Jan 2020 08:49:52 -0700 Subject: bloblist: Zero records when adding It is convenient for bloblist to zero out the contents of a records when it is added. This saves the callers having to do it. Update the API accordingly. Signed-off-by: Simon Glass --- common/bloblist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common/bloblist.c') diff --git a/common/bloblist.c b/common/bloblist.c index 3d0fbbf67d3..99501951e0c 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -73,6 +73,9 @@ static int bloblist_addrec(uint tag, int size, struct bloblist_rec **recp) rec->hdr_size = sizeof(*rec); rec->size = size; rec->spare = 0; + + /* Zero the record data */ + memset(rec + 1, '\0', rec->size); *recp = rec; return 0; -- cgit v1.2.3