Dylan Conway
9a2dfee3ca
Fix env loader buffer overflow by using stack fallback allocator ( #21416 )
...
## Summary
- Fixed buffer overflow in env_loader when parsing large environment
variables with escape sequences
- Replaced fixed 4096-byte buffer with a stack fallback allocator that
automatically switches to heap allocation for larger values
- Added comprehensive tests to prevent regression
## Background
The env_loader previously used a fixed threadlocal buffer that could
overflow when parsing environment variables containing escape sequences.
This caused crashes when the parsed value exceeded 4KB.
## Changes
- Replaced fixed buffer with `StackFallbackAllocator` that uses 4KB
stack buffer for common cases and falls back to heap for larger values
- Updated all env parsing functions to accept a reusable buffer
parameter
- Added proper memory cleanup with defer statements
## Test plan
- [x] Added test cases for large environment variables with escape
sequences
- [x] Added test for values larger than 4KB
- [x] Added edge case tests (empty quotes, escape at EOF)
- [x] All existing env tests continue to pass
fixes #11627
fixes BAPI-1274
🤖 Generated with [Claude Code](https://claude.ai/code )
---------
Co-authored-by: Claude <noreply@anthropic.com >
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-28 00:13:17 -07:00
taylor.fish
07cd45deae
Refactor Zig imports and file structure (part 1) ( #21270 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-22 17:51:38 -07:00
pfg
83760fc446
Sort imports in all files ( #21119 )
...
Co-authored-by: taylor.fish <contact@taylor.fish >
2025-07-21 13:26:47 -07:00
taylor.fish
3b2289d76c
Sync Mutex and Futex with upstream and port std.Thread.Condition ( #21060 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2025-07-15 01:16:40 -07:00
Jarred Sumner
55a9cccac0
bun.sh -> bun.com ( #20909 )
2025-07-10 00:10:43 -07:00
Dylan Conway
f24e8cb98a
implement "nodeLinker": "isolated" in bun install ( #20440 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2025-07-09 00:19:57 -07:00
Jarred Sumner
498186764a
Remove a memcpy ( #20261 )
...
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2025-06-08 05:07:09 -07:00
Jarred Sumner
3ea6133c46
CI: Remove unused top-level decls in formatter in zig ( #19879 )
...
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com >
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-23 22:49:48 -07:00
chloe caruso
3349c995b5
no usingnamespace, organize jsc namespace, enable -fincremental ( #19122 )
...
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com >
2025-04-22 16:34:15 -07:00
chloe caruso
4ec410e0d7
internal: make @import("bun") work in zig ( #19096 )
2025-04-17 12:32:47 -07:00
chloe caruso
903706dccf
file descriptor rewrite ( #18790 )
2025-04-15 09:37:11 -07:00
Don Isaac
f730a355bf
fix: BufferWriter never returns an error ( #18981 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2025-04-13 08:57:41 -07:00
Jarred Sumner
fee911194a
Remove dead code from js_printer ( #18619 )
2025-03-29 04:46:23 -07:00
Zack Radisic
e6cb0de539
CSS modules ( #17958 )
2025-03-06 23:35:06 -08:00
Jarred Sumner
1de31292fb
Add react, tailwind, react+tailwind+shadcn to bun init ( #17282 )
...
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com >
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com >
2025-02-18 10:38:37 -08:00
Jarred Sumner
ba8573494a
Add shadcn, tailwind and react detection & templates to bun create. Also: bun install --analyze <files...> ( #17035 )
2025-02-09 09:36:57 -08:00
chloe caruso
f912e0abc4
hot module reloading for HTML import development mode ( #16955 )
2025-02-08 00:31:30 -08:00
Meghan Denny
26d3688e53
zig: update to 0.14.0-dev ( #16862 )
...
Co-authored-by: nektro <5464072+nektro@users.noreply.github.com >
2025-02-01 01:11:02 -08:00
Meghan Denny
68089a099f
zig: else branch is implicitly void ( #16406 )
2025-01-15 15:14:43 -08:00
Jarred Sumner
2465ccae53
Re-sync our Mutex implementation with zig stdlib ( #16271 )
2025-01-08 21:09:27 -08:00
Ciro Spaciari
fe4176e403
feat(s3) s3 client ( #15740 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com >
2024-12-28 17:46:22 -08:00
Jarred Sumner
d6b9c444c1
Rename src/bundler.zig to src/transpiler.zig ( #15921 )
...
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com >
2024-12-21 00:59:37 -08:00
Dylan Conway
62881ee36b
Redact secrets in bunfig.toml and npmrc logs ( #14919 )
2024-10-31 18:44:24 -07:00
Dylan Conway
5fd0a61ae2
CA support for bun install ( #14416 )
2024-10-11 13:16:26 -07:00
Dylan Conway
39b1c0111e
add docs for bun publish ( #14327 )
2024-10-03 03:41:11 -07:00
Dylan Conway
f374ae6db1
add bun publish ( #14215 )
2024-10-02 20:47:22 -07:00
Ciro Spaciari
1c648063fa
fix(tls/socket/fetch) shutdown fix + ref counted context ( #12925 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-07-30 22:41:54 -07:00
Ciro Spaciari
5a5f3d6b30
fix(http) timeout ( #12728 )
...
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com >
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-07-23 01:13:43 -07:00
Jarred Sumner
226f42e04a
Rewrite js_ast.NewBaseStore ( #12388 )
...
Co-authored-by: dave caruso <me@paperdave.net >
2024-07-10 21:57:40 -07:00
Dylan Conway
4fefb8507c
respect package.json indentation in bun install ( #12328 )
2024-07-03 23:10:34 -07:00
Jarred Sumner
b0018465cc
WebKit upgrade ( #12246 )
...
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com >
2024-07-01 23:27:59 -07:00
Zack Radisic
d563b6485a
Use slow move-based fallback for renameatConcurrently ( #12048 )
...
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com >
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-06-21 20:41:22 -07:00
dave caruso
b76376f8a6
chore: upgrade zig to 0.13.0 ( #9965 )
...
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: Grigory <grigory.orlov.set@gmail.com >
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com >
Co-authored-by: Meghan Denny <hello@nektro.net >
Co-authored-by: Kenta Iwasaki <63115601+lithdew@users.noreply.github.com >
Co-authored-by: John-David Dalton <john.david.dalton@gmail.com >
Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com >
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com >
Co-authored-by: paperdave <paperdave@users.noreply.github.com >
Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com >
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com >
2024-06-20 13:48:39 -07:00
Dylan Conway
fa952b163c
fix(install): tarball extracting bugfix ( #11864 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-06-15 00:22:16 -07:00
Dylan Conway
12f070d1a0
fix #11649 ( #11659 )
2024-06-06 17:26:39 -07:00
Dylan Conway
ac5f2e96c7
fix bun create test should create template from local folder ( #11503 )
2024-06-05 18:29:46 -07:00
Sushant Mishra
e76d212f18
fix: create_command telling to 'cd' when it should be omitted or cd . ( #11567 )
2024-06-05 13:30:22 -07:00
Dylan Conway
dc051ae810
Revert "fix windows todo"
...
This reverts commit ec09e6e238 .
2024-05-31 17:44:35 -07:00
Dylan Conway
ec09e6e238
fix windows todo
2024-05-31 17:44:13 -07:00
Meghan Denny
ecb6c810c8
replace [bun.MAX_PATH_BYTES]u8 with bun.PathBuffer ( #11162 )
2024-05-21 15:55:49 -07:00
Dylan Conway
cacf97ca0a
fix flaky bun-create.test.ts with git templates ( #10662 )
2024-04-29 16:59:07 -07:00
Meghan Denny
685dc02142
windows: fix bun-create ci tests ( #10494 )
...
* windows: fix bun-create ci tests
* fix lint
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-04-24 21:51:05 -07:00
Jarred Sumner
65d8288d81
Revert "fix create with github URL on windows ( #10231 )" ( #10236 )
...
This reverts commit 1820d08d25 .
2024-04-12 20:55:51 -07:00
Dylan Conway
176af5cf58
reachable errors ( #10190 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-04-12 19:02:45 -07:00
Georgijs
1820d08d25
fix create with github URL on windows ( #10231 )
...
* correctly ignore error on windows to match posix behavior
* replace zig accessat with bun.sys.existsAt
* fix posix build
2024-04-12 17:12:44 -07:00
Georgijs
0f10d4f1be
correctly ignore error on windows to match posix behavior ( #10186 )
2024-04-11 15:10:52 -07:00
Meghan Denny
e209ae81dd
meta: ensure there's a single 'bun' import per file in zig ( #10137 )
...
* meta: ensure there's a single 'bun' import per file in zig
* undo this change in codegen
2024-04-09 22:41:07 -07:00
dave caruso
f02752577b
fix: which should use cwd if given a relative filepath ( #9761 )
...
* Revert "fix!: do not lookup cwd in which (#9691 )"
This reverts commit 4869ebff24 .
* fix which implementation to be more accurate
* t
* which tests windows
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-31 16:50:16 -07:00
dave caruso
4869ebff24
fix!: do not lookup cwd in which ( #9691 )
...
* do not lookup cwd in which
* fix webkit submodule
* fix compilation on linux
* feedback
2024-03-29 16:42:17 -07:00
Meghan Denny
e3bf906127
memoize all calls to selfExePath ( #9703 )
...
* memoize all calls to selfExePath
* Fix threadsafety issue
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2024-03-29 13:29:42 -07:00