krb5 commit: Disable include and includedir in fuzzing build

ghudson at mit.edu ghudson at mit.edu
Mon Oct 14 12:45:07 EDT 2024


https://github.com/krb5/krb5/commit/5319b5666e3cc5420b483c3ec1cfdbc6ccdefa5d
commit 5319b5666e3cc5420b483c3ec1cfdbc6ccdefa5d
Author: Arjun <pkillarjun at protonmail.com>
Date:   Fri Oct 11 00:37:52 2024 +0530

    Disable include and includedir in fuzzing build
    
    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 at mit.edu: edited commit message]

 src/util/profile/prof_parse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/util/profile/prof_parse.c b/src/util/profile/prof_parse.c
index 2e329de4e..4b1656c41 100644
--- a/src/util/profile/prof_parse.c
+++ b/src/util/profile/prof_parse.c
@@ -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])) {


More information about the cvs-krb5 mailing list