]> git.ipfire.org Git - thirdparty/grub.git/commit
util/resolve: Bail with error if moddep.lst file line is too long
authorGlenn Washburn <development@efficientek.com>
Thu, 13 Jan 2022 02:55:01 +0000 (20:55 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 8 Feb 2022 15:04:57 +0000 (16:04 +0100)
commit45bffae133365bc5033d841fbea6f325108fa733
treeda0a3cf6ebac49fa9e224324d2cafa5564e557ac
parentddf47bdb042ab0ea52bc713b5f80cc48543f0469
util/resolve: Bail with error if moddep.lst file line is too long

The code reads each line into a buffer of size 1024 and does not check if
the line is longer. So a line longer than 1024 will be read as a valid line
followed by an invalid line. Then an error confusing to the user is sent
with the test "invalid line format". But the line format is perfectly fine,
the problem is in GRUB's parser. Check if we've hit a line longer than the
size of the buffer, and if so send a more correct and reasonable error.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/resolve.c