]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check before dreference. CID #1414436
authorAlan T. DeKok <aland@freeradius.org>
Thu, 19 Oct 2017 19:26:57 +0000 (15:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 19 Oct 2017 19:26:57 +0000 (15:26 -0400)
src/main/cf_util.c

index 6e823eefe0edfd3e20ae36e70f9887f2174997ea..c0f1adc38fc217159f7e90a5469355648d5a03a9 100644 (file)
@@ -1564,8 +1564,8 @@ static inline void truncate_filename(char const **e, char const **p, int *len, c
        *len = FILENAME_TRUNCATE;
 
        q = strchr(*p, FR_DIR_SEP);
-       q++;
        if (q) {
+               q++;
                *p += (q - *p);
                *len -= (q - *p);
        }