]> git.ipfire.org Git - thirdparty/grub.git/commit
util/grub-editenv: Fix incorrect casting of a signed value
authorDarren Kenny <darren.kenny@oracle.com>
Thu, 5 Nov 2020 14:33:50 +0000 (14:33 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:17 +0000 (15:54 +0100)
commit5dc41edc4eba259c6043ae7698c245ec1baaacc6
treed3e7f09107c295674d28be3de5eabda6a2e23591
parent8b3a95655b4391122e7b0315d8cc6f876caf8183
util/grub-editenv: Fix incorrect casting of a signed value

The return value of ftell() may be negative (-1) on error. While it is
probably unlikely to occur, we should not blindly cast to an unsigned
value without first testing that it is not negative.

Fixes: CID 73856
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-editenv.c