]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
shhh clang scan
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 May 2017 20:59:06 +0000 (16:59 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 May 2017 20:59:06 +0000 (16:59 -0400)
src/protocols/radius/encode.c

index 21bcca05d9578fba0f55c3fe3c3b7de88c295785..0dc72732aa08f65056050924ddb62680c670a2c6 100644 (file)
@@ -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;