[coreboot-gerrit] Patch merged into coreboot/master: libpayload/libc: Fix memset/sizeof usage
gerrit at coreboot.org
gerrit at coreboot.org
Wed Apr 6 13:33:10 CEST 2016
the following patch was just integrated into master:
commit a4fbc385e0910510b0e46007a51c8d48609e88a8
Author: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Date: Tue Apr 5 21:36:34 2016 +0200
libpayload/libc: Fix memset/sizeof usage
Since r is a pointer, memset(r, 0, sizeof(r)) would only zero the first
4 (or 8) bytes of the newly allocated struct align_region_t.
An alternative to this patch would be to use calloc, or introduce a new
zalloc (zeroed allocation; a single-element calloc) and use that.
Change-Id: Ic3e3487ce749eeebf6c4836e62b8a305ad766e7e
Found-by: Coverity (ID 1291160)
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Reviewed-on: https://review.coreboot.org/14244
Reviewed-by: Aaron Durbin <adurbin at chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter at users.sourceforge.net>
See https://review.coreboot.org/14244 for details.
-gerrit
More information about the coreboot-gerrit
mailing list