From: Arran Cudbard-Bell Date: Wed, 24 May 2017 20:59:06 +0000 (-0400) Subject: shhh clang scan X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daa0523cb6abf0c487b65a7d667465411bf5d583;p=thirdparty%2Ffreeradius-server.git shhh clang scan --- diff --git a/src/protocols/radius/encode.c b/src/protocols/radius/encode.c index 21bcca05d95..0dc72732aa0 100644 --- a/src/protocols/radius/encode.c +++ b/src/protocols/radius/encode.c @@ -746,9 +746,10 @@ static ssize_t encode_value(uint8_t *out, size_t outlen, } /* - * No data: skip it. + * No data: don't encode the value. The type and length should still + * be written. */ - if (len == 0) { + if (!data || (len == 0)) { vp = next_encodable(cursor); fr_proto_tlv_stack_build(tlv_stack, vp ? vp->da : NULL); return 0;