diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2016-04-05 21:36:34 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2016-04-06 13:33:07 +0200 |
commit | a4fbc385e0910510b0e46007a51c8d48609e88a8 (patch) | |
tree | 26d4b0c22df6be9ecf8af4da7e21f7c7b78f77db /util/cbfstool | |
parent | 2fff2a6e31312be2894c8e7c1a4f53cb14e94a74 (diff) |
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>
Diffstat (limited to 'util/cbfstool')
0 files changed, 0 insertions, 0 deletions