Skip to content

Commit

Permalink
Compilation: check for embedded null bytes in path for has_include
Browse files Browse the repository at this point in the history
  • Loading branch information
ehaas authored and Vexu committed Nov 28, 2023
1 parent efed229 commit f292797
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/aro/Compilation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,10 @@ pub fn hasInclude(
/// __has_include vs __has_include_next
which: WhichInclude,
) !bool {
if (mem.indexOfScalar(u8, filename, 0) != null) {
return false;
}

const cwd = std.fs.cwd();
if (std.fs.path.isAbsolute(filename)) {
if (which == .next) return false;
Expand Down

0 comments on commit f292797

Please sign in to comment.