From: Arjun Date: Thu, 10 Oct 2024 19:07:52 +0000 (+0530) Subject: Disable include and includedir in fuzzing build X-Git-Tag: krb5-1.22-beta1~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5319b5666e3cc5420b483c3ec1cfdbc6ccdefa5d;p=thirdparty%2Fkrb5.git 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@mit.edu: edited commit message] --- diff --git a/src/util/profile/prof_parse.c b/src/util/profile/prof_parse.c index 2e329de4e0..4b1656c41f 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])) {