Parse a VALUE as an integer only if ALL of its characters
authoraland <aland>
Sun, 26 Nov 2006 19:54:00 +0000 (19:54 +0000)
committeraland <aland>
Sun, 26 Nov 2006 19:54:00 +0000 (19:54 +0000)
are decimal digits

src/lib/valuepair.c

index 5457770..2c67bde 100644 (file)
@@ -706,7 +706,7 @@ VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value)
                         *
                         *      Note that ALL integers are unsigned!
                         */
-                       if (isdigit((int) *value)) {
+                       if (strspn(value, "0123456789") == strlen(value)) {
                                vp->lvalue = (uint32_t) strtoul(value, NULL, 10);
                                vp->length = 4;
                        }