summaryrefslogtreecommitdiff
path: root/lib/hash-checksum.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-08-22 12:21:13 +0200
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-08-23 08:02:59 +0200
commit175e4b01beed25dedbd17a082786ec2e6739f1b3 (patch)
tree6bb771c48fe1605ef861c2519d14a9362a478ff5 /lib/hash-checksum.c
parent976fb2ffa3875a7bed9866bf5cf939a81c423ef8 (diff)
cmd: setexpr: fix printf_str()
If vsnprintf() returns a negative number, (i >= remaining) will possibly be true: 'i' is of type signed int and 'remaining' is of the unsigned type size_t. The C language will convert i to an unsigned type before the comparison. This can result in the wrong error type being indicated. Checking for negative i should be done first. Fixes: f4f8d8bb1abc ("cmd: setexpr: add format string handling") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/hash-checksum.c')
0 files changed, 0 insertions, 0 deletions