View Change
3 comments:
File lspcon_i2c_spi.c:
Patch Set #4, Line 364: uint8_t write_buffer[len + 1];
We can use a fixed size buffer with buf[256 + 1] since that'd be the max size. […]
You could have a static buffer of len 257 /* extra byte needed for prefixing zero in idx 0 */
and a if check to validate len does not exceed the static buffer before the memcpy()
Patch Set #4, Line 365: write_buffer[0] = 0
Do you have any idea if we have to change this or resolve the comment?
by initialising the static buf to zero you can skip this.
Patch Set #4, Line 366: write_buffer + 1
just say &write_buf[1] here, kind of makes it more clear.
To view, visit change 39687. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I039e683252cfaf1ffef8694a3e8081b1b6b944f7
Gerrit-Change-Number: 39687
Gerrit-PatchSet: 7
Gerrit-Owner: Shiyu Sun <sshiyu@google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus@gmail.com>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-CC: Sam McNally <sammc@google.com>
Gerrit-Comment-Date: Wed, 01 Apr 2020 04:47:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Shiyu Sun <sshiyu@google.com>
Comment-In-Reply-To: Edward O'Callaghan <quasisec@chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus@gmail.com>
Gerrit-MessageType: comment