]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
More fixes for Coverity.
authorAlan T. DeKok <aland@freeradius.org>
Thu, 14 Mar 2013 00:57:52 +0000 (20:57 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 14 Mar 2013 01:42:00 +0000 (21:42 -0400)
It can't tell that dict_attrunknown always returns type=octets

src/lib/radius.c

index 4baf35254009e813ce12dda6d5e2a99ef27fec4c..a51be5c837ae874ae4203358402bb3c7ca8aeca0 100644 (file)
@@ -3455,6 +3455,15 @@ static ssize_t data2vp(const RADIUS_PACKET *packet,
                        return -1;
                }
                tag = 0;
+#ifndef NDEBUG
+               /*
+                *      Fix for Coverity.
+                */
+               if (da->type != PW_TYPE_OCTETS) {
+                       dict_attr_free(&da);
+                       return -1;
+               }
+#endif
                break;
        }