]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Disable include and includedir in fuzzing build
authorArjun <pkillarjun@protonmail.com>
Thu, 10 Oct 2024 19:07:52 +0000 (00:37 +0530)
committerGreg Hudson <ghudson@mit.edu>
Mon, 14 Oct 2024 16:18:17 +0000 (12:18 -0400)
When building for fuzz teting, ignore "include" and "incluedir"
directives in the profile library's parse_line(), to prevent it from
trying to open non-existent paths generated by the fuzzing library.

[ghudson@mit.edu: edited commit message]

src/util/profile/prof_parse.c

index 2e329de4e033650b9edcca7874e8587b32fc64bb..4b1656c41ffbac39a3780c58c22298bf8bd3f6af 100644 (file)
@@ -292,6 +292,7 @@ static errcode_t parse_line(char *line, struct parse_state *state,
 {
     char    *cp;
 
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
     if (strncmp(line, "include", 7) == 0 && isspace(line[7])) {
         cp = skip_over_blanks(line + 7);
         strip_line(cp);
@@ -302,6 +303,7 @@ static errcode_t parse_line(char *line, struct parse_state *state,
         strip_line(cp);
         return parse_include_dir(cp, state->root_section);
     }
+#endif
     switch (state->state) {
     case STATE_INIT_COMMENT:
         if (strncmp(line, "module", 6) == 0 && isspace(line[6])) {