Attention is currently required from: Miklós Márton, Angel Pons, Anastasia Klimchuk.
View Change
3 comments:
File ni845x_spi.c:
Patch Set #1, Line 188: strtol
Use `strtoul()` instead?
+1
Patch Set #1, Line 556: CS_number = CS_str[0] - '0';
This line converts string to number, but only two lines below the condition is checked whether the s […]
That's not a problem though, is it? These are just numbers in C. It might
underflow, but that's still defined behavior and the `7 < CS_number` would
catch it?
Patch Set #1, Line 556:
CS_number = CS_str[0] - '0';
free(CS_str);
if (strlen(CS_str) > 1 || 7 < CS_number) {
msg_perr("Only CS 0-7 supported\n");
return 1;
}
The assignment to `CS_number` can underflow. I'd do the parsing as follows: […]
I would just use strtoul() TBH :)
To view, visit change 56637. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I48ef927aa28433fb0e3b3a1f3fb2e797095e53bd
Gerrit-Change-Number: 56637
Gerrit-PatchSet: 1
Gerrit-Owner: Miklós Márton <martonmiklosqdev@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: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Attention: Miklós Márton <martonmiklosqdev@gmail.com>
Gerrit-Attention: Angel Pons <th3fanbus@gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Comment-Date: Tue, 17 Aug 2021 10:51:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Angel Pons <th3fanbus@gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-MessageType: comment