]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove needless check of parent in parse_input() (CID #1469153 (#4480)
authorJames Jones <jejones3141@gmail.com>
Fri, 29 Apr 2022 19:15:36 +0000 (14:15 -0500)
committerGitHub <noreply@github.com>
Fri, 29 Apr 2022 19:15:36 +0000 (15:15 -0400)
Earlier in the code, parent->allow_unlang is tested; if parent
is NULL, it will break thre, so the later check is unnecessary.

src/lib/server/cf_file.c

index 3d5612faba09d47395be40ed638844117e19a15d..de45ccb543953a43dc71ce32a9ffff4b8a43080f 100644 (file)
@@ -1674,6 +1674,8 @@ static int parse_input(cf_stack_t *stack)
        buff[2] = stack->buff[2];
        buff[3] = stack->buff[3];
 
+       fr_assert(parent != NULL);
+
        /*
         *      Catch end of a subsection.
         */
@@ -1888,7 +1890,7 @@ static int parse_input(cf_stack_t *stack)
                /*
                 *      As a hack, allow any operators when using &foo=bar
                 */
-               if ((!parent || !frame->special) && (buff[1][0] != '&')) {
+               if (!frame->special && (buff[1][0] != '&')) {
                        ERROR("%s[%d]: Invalid operator in assignment for %s ...",
                              frame->filename, frame->lineno, buff[1]);
                        return -1;