]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Clarify parse error for ascend attributes
authorAlan T. DeKok <aland@freeradius.org>
Tue, 25 Jan 2011 16:20:54 +0000 (17:20 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 25 Jan 2011 16:20:54 +0000 (17:20 +0100)
Printing to the same string we're reading from is a bad idea.

src/lib/valuepair.c

index 6e63e7abfccf7983d15083ceacaf3ea516b2427d..bda19385eeac5eacc899e13c7a9729d4b2453af3 100644 (file)
@@ -1069,8 +1069,10 @@ VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value)
                        }
 
                        if (ascend_parse_filter(vp) < 0 ) {
-                               fr_strerror_printf("failed to parse Ascend binary attribute: %s",
-                                          fr_strerror());
+                               char buffer[256];
+
+                               snprintf(buffer, sizeof(buffer), "failed to parse Ascend binary attribute: %s", fr_strerror());
+                               fr_strerror_printf("%s", buffer);
                                return NULL;
                        }
                        break;