]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use strncmp instead of memcmp so we don't overrun the buffer pointed to by ptr
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 5 Jul 2017 16:38:29 +0000 (12:38 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 5 Jul 2017 16:38:29 +0000 (12:38 -0400)
src/main/cf_file.c

index 79081b4b0c01b061004324aa4ab28c3a6a546f7d..ee27b6c3e495ba92e754e63cc464d97ed4d527b1 100644 (file)
@@ -251,7 +251,7 @@ char const *cf_expand_variables(char const *cf, int *lineno,
                                ERROR("%s[%d]: Reference \"%s\" type is invalid", cf, *lineno, input);
                                return NULL;
                        }
-               } else if (memcmp(ptr, "$ENV{", 5) == 0) {
+               } else if (strncmp(ptr, "$ENV{", 5) == 0) {
                        char *env;
 
                        ptr += 5;