Hacks for Coverity.
authorAlan T. DeKok <aland@freeradius.org>
Sat, 2 Mar 2013 14:53:36 +0000 (09:53 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 2 Mar 2013 15:12:41 +0000 (10:12 -0500)
We know that editing the dictionaries won't happen.  Coverity doesn't

src/lib/radius.c

index b548f92..5fd4198 100644 (file)
@@ -3195,6 +3195,15 @@ static ssize_t data2vp(const RADIUS_PACKET *packet,
                        return 0;
                }
 
+#ifndef NDEBUG
+               /*
+                *      Hacks for Coverity.  Editing the dictionary
+                *      will break assumptions about CUI.  We know
+                *      this, but Coverity doesn't.
+                */
+               if (da->type != PW_TYPE_STRING) return -1;
+#endif
+
                data = (const uint8_t *) "";
                datalen = 1;
                goto alloc_cui; /* skip everything */