Be a little smarter about allowing VALUE names that start
authoraland <aland>
Sat, 27 May 2006 00:17:22 +0000 (00:17 +0000)
committeraland <aland>
Sat, 27 May 2006 00:17:22 +0000 (00:17 +0000)
with digits.  It turns out there's a bunch of these in the
dictionaries that haven't yet been caught, so being smarter
here helps a lot.

src/lib/valuepair.c

index c8cfe25..acb8c6a 100644 (file)
@@ -773,15 +773,14 @@ VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value)
                        break;
                case PW_TYPE_INTEGER:
                        /*
-                        *      If it starts with a digit, it must
-                        *      be a number (or a range).
-                        *
                         *      Note that ALL integers are unsigned!
                         */
-                       if (isdigit((int) *value)) {
+                       if (isdigit((int) value[0]) &&
+                           (strspn(value, "0123456789") == strlen(value))) {
                                vp->lvalue = (uint32_t) strtoul(value, NULL, 10);
                                vp->length = 4;
                        }
+
                        /*
                         *      Look for the named value for the given
                         *      attribute.