Attention is currently required from: Felix Singer, Nico Huber, Light, Anastasia Klimchuk.

Light uploaded patch set #15 to this change.

View Change

flashrom.c, sfdp.c: Initialize dynamically allocated memory using calloc

In flashrom_image_write variables curcontents and oldcontents are
dynamically allocated using malloc. These could remain uninitialized and
when later used in need_erase could result in undefined behaviour.
Similar reasoning for variables hbuf, hdrs, tbuf in function
prob_spi_sfdp.

So allocate them using calloc to initialize them to zeroes. Also, copy
"FLASHROM BUG!" to detect future bugs.

Change-Id: I6b9269129968fb3b55b0d2a2e384c8a1aeba43ab
Signed-off-by: Aarya Chaumal <aarya.chaumal@gmail.com>
---
M flashrom.c
M sfdp.c
2 files changed, 9 insertions(+), 4 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/47/62747/15

To view, visit change 62747. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I6b9269129968fb3b55b0d2a2e384c8a1aeba43ab
Gerrit-Change-Number: 62747
Gerrit-PatchSet: 15
Gerrit-Owner: Light <aarya.chaumal@gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus@gmail.com>
Gerrit-CC: Felix Singer <felixsinger@posteo.net>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Attention: Felix Singer <felixsinger@posteo.net>
Gerrit-Attention: Nico Huber <nico.h@gmx.de>
Gerrit-Attention: Light <aarya.chaumal@gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-MessageType: newpatchset