]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
value may be NULL
authorAlan T. DeKok <aland@freeradius.org>
Sun, 17 Feb 2013 16:11:30 +0000 (11:11 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 17 Feb 2013 16:11:30 +0000 (11:11 -0500)
If the admin misconfigures things, oh well

src/main/mainconfig.c

index 843101b8640b72dec6ac538667105f322e5e456b..6a29b94860b184127b9692e75a62c9acbaef97e0 100644 (file)
@@ -377,10 +377,13 @@ static size_t xlat_config(void *instance, REQUEST *request,
         *  If 'outlen' is too small, then the output is chopped to fit.
         */
        value = cf_pair_value(cp);
-       if (value) {
-               if (outlen > strlen(value)) {
-                       outlen = strlen(value) + 1;
-               }
+       if (!value) {
+               out[0] = '\0';
+               return 0;
+       }
+
+       if (outlen > strlen(value)) {
+               outlen = strlen(value) + 1;
        }
 
        return func(out, outlen, value);