diff options
author | David Robillard <d@drobilla.net> | 2024-12-11 16:18:03 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-12-11 16:18:03 -0500 |
commit | 22d0e471ee76d065e535cea9880af29375895cc4 (patch) | |
tree | 84b3b167cedd88f76e60002654d5b4e92cf10cd4 | |
parent | f24963e3fcca949456e3867d9d0776e3fc63c1a4 (diff) | |
download | serd-22d0e471ee76d065e535cea9880af29375895cc4.tar.gz serd-22d0e471ee76d065e535cea9880af29375895cc4.tar.bz2 serd-22d0e471ee76d065e535cea9880af29375895cc4.zip |
Fix widening conversions after arithmetic
Overflow isn't actually possible here, but this avoids the issue statically in
a way that won't trigger analysis tools.
-rw-r--r-- | src/base64.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/base64.c b/src/base64.c index ce8af162..b12db9ff 100644 --- a/src/base64.c +++ b/src/base64.c @@ -91,7 +91,7 @@ decode_chunk(const uint8_t in[4], uint8_t out[3]) out[0] = (uint8_t)(((unmap(in[0]) << 2)) | unmap(in[1]) >> 4); out[1] = (uint8_t)(((unmap(in[1]) << 4) & 0xF0) | unmap(in[2]) >> 2); out[2] = (uint8_t)(((unmap(in[2]) << 6) & 0xC0) | unmap(in[3])); - return 1U + (in[2] != '=') + ((in[2] != '=') && (in[3] != '=')); + return (size_t)1U + (in[2] != '=') + ((in[2] != '=') && (in[3] != '=')); } void* |