From: Arran Cudbard-Bell Date: Thu, 15 Apr 2021 20:23:03 +0000 (-0500) Subject: Or just set inlen correctly when in is NULL X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6299664ad821be07ce8a398f19ef077c7ec2a41a;p=thirdparty%2Ffreeradius-server.git Or just set inlen correctly when in is NULL --- diff --git a/src/lib/util/md5.c b/src/lib/util/md5.c index 31180ce52fe..0b9488b7cf3 100644 --- a/src/lib/util/md5.c +++ b/src/lib/util/md5.c @@ -461,7 +461,10 @@ static void fr_md5_local_update(fr_md5_ctx_t *ctx, uint8_t const *in, size_t inl * ubsan doesn't like arithmetic on * NULL pointers. */ - if (!in) in = (uint8_t[MD5_BLOCK_LENGTH]){ 0x00 }; + if (!in) { + in = (uint8_t[]){ 0x00 }; + inlen = 0; + } /* Check how many bytes we already have and how many more we need. */ have = (size_t)((ctx_local->count[0] >> 3) & (MD5_BLOCK_LENGTH - 1));