From: Alan T. DeKok Date: Sun, 17 Feb 2013 16:11:30 +0000 (-0500) Subject: value may be NULL X-Git-Tag: release_2_2_1~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82f82ddcef02a78743037fedf2bb5743ed5a446d;p=thirdparty%2Ffreeradius-server.git value may be NULL If the admin misconfigures things, oh well --- diff --git a/src/main/mainconfig.c b/src/main/mainconfig.c index 843101b8640..6a29b94860b 100644 --- a/src/main/mainconfig.c +++ b/src/main/mainconfig.c @@ -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);