]> git.ipfire.org Git - thirdparty/hostap.git/commit
UBSan: Avoid unsigned integer overflow in base64 encoding
authorJouni Malinen <j@w1.fi>
Sat, 23 Feb 2019 14:09:31 +0000 (16:09 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 25 Feb 2019 17:48:49 +0000 (19:48 +0200)
commit43216777e5e4ecc4ffdce7471925970f4f1a701b
treec4d9648c628d83ffba1e6b51d4992983d1287c07
parentfed7d8fcba68729fe7de9018422c0006fd00c642
UBSan: Avoid unsigned integer overflow in base64 encoding

Add a constraint on the base64 encoded buffer length to avoid an integer
overflow in the output length calculation.

common.c:1087:16: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')

Signed-off-by: Jouni Malinen <j@w1.fi>
src/utils/base64.c