]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Check for more parse errors when reading dicts. Bug found by Coverity
authorAlan T. DeKok <aland@freeradius.org>
Thu, 6 Sep 2012 09:32:16 +0000 (11:32 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 6 Sep 2012 09:33:18 +0000 (11:33 +0200)
src/lib/dict.c

index 439f80ff9a9b2f88d0f20b5e7ae270b9ef58d0ee..c364e274f4662e62c3ad73f62d6e1ca96f89f5d4 100644 (file)
@@ -1253,6 +1253,12 @@ static int process_vendor(const char* fn, const int line, char **argv,
                length = (int) (p[2] - '0');
 
                if (p[3] == ',') {
+                       if (!p[4]) {
+                               fr_strerror_printf("dict_init: %s[%d]: Invalid format for VENDOR.  Expected text like \"1,1\", got \"%s\"",
+                                  fn, line, p);
+                               return -1;
+                       }
+
                        if ((p[4] != 'c') ||
                            (p[5] != '\0')) {
                                fr_strerror_printf("dict_init: %s[%d]: Invalid format for VENDOR.  Expected text like \"1,1\", got \"%s\"",