coreboot-kgpe-d16/payloads/libpayload/libc
Jonathan Neuschäfer a4fbc385e0 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@gmx.net>
Reviewed-on: https://review.coreboot.org/14244
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-04-06 13:33:07 +02:00
..
64bit_div.c
Makefile.inc
args.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
console.c libpayload: Make Kconfig bools use IS_ENABLED() 2015-06-30 18:55:15 +02:00
coreboot.c
ctype.c
die.c libpayload: Add a new "die" function to fatally signal programming errors. 2014-09-15 17:37:13 +02:00
exec.c libpayload: Make Kconfig bools use IS_ENABLED() 2015-06-30 18:55:15 +02:00
fmap.c libpayload: Add support for handling fmaps 2015-07-14 18:12:06 +02:00
getopt_long.c
hexdump.c
ipchecksum.c trivial fix: ipchksum takes an unspecified input blob, not explicitly a number of shorts. 2008-08-16 15:16:36 +00:00
lib.c
libgcc.c lib: Unify log2() and related functions 2015-06-05 13:18:55 +02:00
malloc.c libpayload/libc: Fix memset/sizeof usage 2016-04-06 13:33:07 +02:00
memory.c
printf.c
qsort.c
rand.c Add rand/rand_r/srand functions for generating pseudo-random bytes. 2008-04-07 23:33:50 +00:00
readline.c Catch various cases in libpayload where malloc() or memalign() return NULL 2009-07-31 11:39:55 +00:00
string.c
strlcpy.c
sysinfo.c Reduce warnings/errors in libpayload when using picky compiler options 2011-06-30 20:41:23 +02:00
time.c