summaryrefslogtreecommitdiffstats
path: root/cli_classic.c
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2019-08-12 14:14:40 -0600
committerNico Huber <nico.h@gmx.de>2019-09-24 19:09:29 +0000
commit1c0c8fd9da34d29d549803f3ddff9a68dd95dfed (patch)
tree4cdf8d00d844fc0286f05cda7677d298d9ead6b9 /cli_classic.c
parent4a7970bc98c5bacd2cebcc2b4a3a39be304a1cae (diff)
downloadflashrom-1c0c8fd9da34d29d549803f3ddff9a68dd95dfed.tar.gz
flashrom-1c0c8fd9da34d29d549803f3ddff9a68dd95dfed.tar.bz2
flashrom-1c0c8fd9da34d29d549803f3ddff9a68dd95dfed.zip
linux_spi: Use fgets() to read buffer size
Since fread() returns the number of bytes read, this currently will only check for errors if it returns 0 (i.e. the file was empty). However, it is possible for fread() to encounter an error after reading a few bytes, which this doesn't catch. Fix this by using fgets() instead, which will return NULL if EOF or an error is encountered, and is simpler anyway. Change-Id: I4f37c70e97149b87c6344e63a57d11ddde7638c4 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Found-by: Coverity CID 1403824 Reviewed-on: https://review.coreboot.org/c/flashrom/+/34848 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Diffstat (limited to 'cli_classic.c')
0 files changed, 0 insertions, 0 deletions