diff options
author | 2021-12-31 15:06:06 -0800 | |
---|---|---|
committer | 2021-12-31 15:06:06 -0800 | |
commit | 059aa425b793f4f4c79fccaa9c42b0b9329e9fb0 (patch) | |
tree | e9383076cc1db51756b0dd280d494ef806f963c1 | |
parent | aaf5c28c5b1c134f57c12f5f93e859f8fa73ae51 (diff) | |
download | bun-059aa425b793f4f4c79fccaa9c42b0b9329e9fb0.tar.gz bun-059aa425b793f4f4c79fccaa9c42b0b9329e9fb0.tar.zst bun-059aa425b793f4f4c79fccaa9c42b0b9329e9fb0.zip |
Fix an edgecase that causes a crash in HTTP server
Diffstat (limited to '')
-rw-r--r-- | src/deps/picohttp.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/deps/picohttp.zig b/src/deps/picohttp.zig index f4a662c28..6c00c185b 100644 --- a/src/deps/picohttp.zig +++ b/src/deps/picohttp.zig @@ -72,7 +72,7 @@ pub const Request = struct { ); // Leave a sentinel value, for JavaScriptCore support. - @intToPtr([*]u8, @ptrToInt(path.ptr))[path.len] = 0; + if (rc > -1) @intToPtr([*]u8, @ptrToInt(path.ptr))[path.len] = 0; return switch (rc) { -1 => error.BadRequest, |