Claude Bot
e4618043c4
Fix Postgres array alignment issue causing use-after-free panic
...
This fixes the "panic: incorrect alignment" error that occurred in
postgres_types.zig:242 when processing binary array data from PostgreSQL.
The issue was caused by @alignCast failing when the network data wasn't
properly aligned for the struct type. The original code tried to directly
cast misaligned byte data to a struct pointer, which violates Zig's
alignment requirements.
## Root Cause
In PostgresBinarySingleDimensionArray.init(), the code used:
```zig
const this: *@This() = @alignCast(@ptrCast(@constCast(bytes.ptr)));
```
This would panic if bytes.ptr wasn't aligned to the struct's alignment
requirements (typically 4 bytes for i32 fields).
## Solution
- Read integer values safely using std.mem.readInt() with proper endianness
- Always allocate properly aligned memory using bun.default_allocator.alignedAlloc()
- Copy the original data to the aligned memory buffer
- Parse and set the struct fields explicitly instead of relying on memory layout
This ensures memory safety while maintaining compatibility with the existing
DataCell.deinit() infrastructure that expects bun.default_allocator allocations.
## Tests
- Added regression tests to verify the fix handles alignment correctly
- Added integration tests for array processing with various data sizes
- Verified that memory is properly allocated and can be freed correctly
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-07-16 01:18:09 +00:00
Jarred Sumner
2e02d9de28
Use ReadableStream.prototype.* in tests instead of new Response(...).* ( #20937 )
...
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com >
Co-authored-by: Alistair Smith <hi@alistair.sh >
Co-authored-by: Claude Bot <claude-bot@bun.sh >
Co-authored-by: Claude <noreply@anthropic.com >
2025-07-14 00:47:53 -07:00
Adam
7ba4b1d01e
Fix: deprecated goo.gl links in snapshots raised in issue #20086 ( #20424 )
2025-07-05 00:58:42 -07:00
Jarred Sumner
0d4089ea7c
Fixes #20753 ( #20789 )
...
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2025-07-03 01:06:22 -07:00
Kai Tamkun
adfdaab4fd
Add test for #20144 ( #20171 )
2025-06-03 23:41:37 -07:00
Jarred Sumner
1bd44e9ce7
Fixes #18239 ( #20152 )
2025-06-03 13:23:12 -07:00
Alistair Smith
31980bc151
perf_hooks.Histogram ( #19920 )
2025-05-26 21:18:22 -07:00
Seth Flynn
c024e73e6a
fix(BunRequest): make clone() return a BunRequest ( #19813 )
2025-05-23 23:37:47 -07:00
pfg
89c5e40544
ReadableStream & ReadableByteStream fixes ( #19683 )
2025-05-16 22:30:58 -07:00
Jarred Sumner
14b439a115
Fix formatters not running in CI + delete unnecessary files ( #19433 )
2025-05-08 23:22:16 -07:00
pfg
500199fe8b
More node tests ( #19197 )
2025-05-07 16:21:08 -07:00
Ciro Spaciari
cb6abd2116
fix(node:http) proper send chunked encoding, dont send \r\b twice after headers are flushed ( #19344 )
2025-04-28 16:48:36 -07:00
Kai Tamkun
5392cd1d28
Call node:http request callback through AsyncContextFrame ( #18711 )
2025-04-01 19:27:45 -07:00
Dylan Conway
c21fca08e2
fix node:crypto hash name regression ( #18481 )
2025-03-25 20:43:41 -07:00
Meghan Denny
e602e2b887
Revert "disallow test() within test()" ( #18338 )
2025-03-20 20:12:20 -07:00
pfg
74768449bc
disallow test() within test() ( #18203 )
2025-03-15 21:34:35 -07:00
Ashcon Partovi
d7e08abce8
Fix setTimeout(() => {}) from emitting a warning ( #18160 )
2025-03-13 11:37:48 -07:00
Kai Tamkun
4a0e982bb2
node:http improvements ( #17093 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: Pham Minh Triet <92496972+Nanome203@users.noreply.github.com >
Co-authored-by: snwy <snwy@snwy.me >
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com >
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com >
Co-authored-by: Ben Grant <ben@bun.sh >
2025-03-10 20:19:29 -07:00
Don Isaac
a41d773aaa
feat: support Svelte in bundler and dev server ( #17735 )
2025-03-04 14:16:18 -08:00
pfg
821f42dd8e
upgrade webkit ( #17889 )
2025-03-03 21:38:05 -08:00
Ashcon Partovi
1060558456
Fix Jest globals not being available in non-entrypoint files ( #17734 )
2025-02-26 16:02:15 -08:00
Dylan Conway
47f9bb84e8
fix: invalid json import regression ( #17612 )
2025-02-24 01:57:29 -08:00
pfg
92a91ef2fd
Fix hosting destructured decl with movable initializer ( #17468 )
2025-02-19 20:21:52 -08:00
chloe caruso
78e52006c5
Rewrite internal Web Streams to use less memory ( #16860 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: pfg <pfg@pfg.pw >
2025-02-15 01:16:28 -08:00
pfg
1ddf3fc097
Fix fetch with formdata on some servers ( #16947 )
2025-01-31 22:39:43 -08:00
190n
af27f9e697
Allow WTF timers to participate in the event loop ( #15557 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
Co-authored-by: 190n <190n@users.noreply.github.com >
Co-authored-by: 190n <7763597+190n@users.noreply.github.com >
2025-01-28 17:47:53 -08:00
pfg
76f5c91ffb
Regression test for 16702 ( #16853 )
2025-01-28 17:23:57 -08:00
Jarred Sumner
68ee83067e
Revert "Rewrite the internal Web Stream native bindings to use less m… ( #16795 )
2025-01-27 05:39:37 -08:00
Jarred Sumner
75a95aa5fa
Rewrite the internal Web Stream native bindings to use less memory ( #16349 )
2025-01-26 00:04:39 -08:00
Meghan Denny
af79cebf9e
unflag experimental css and html ( #16561 )
...
Co-authored-by: nektro <5464072+nektro@users.noreply.github.com >
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com >
2025-01-21 06:44:54 -08:00
Dylan Conway
3128beed67
fix fs.mkdir regression ( #16497 )
2025-01-19 16:07:18 -08:00
pfg
e46e922307
Strip query parameter in File import ( #16480 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2025-01-18 12:40:43 -08:00
pfg
0d17843251
Fix bun run folder ( #15117 )
...
Co-authored-by: pfgithub <pfgithub@users.noreply.github.com >
2025-01-17 22:08:07 -08:00
pfg
01c83cdcfe
Regression test for #11806 ( #16392 )
2025-01-14 13:22:15 +00:00
pfg
b04ce670e3
Fix #16312 ( #16322 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2025-01-10 20:04:16 -08:00
Dylan Conway
c130df6c58
start verdaccio in multiple test files ( #16118 )
2025-01-03 08:21:00 -08:00
Lars Volkheimer
e96dded366
fix formatting of Set in Bun.inspect() ( #16013 )
2024-12-30 13:44:40 -08:00
dave caruso
41924211f2
add throw: true in Bun.build, to be made default in 1.2 ( #15861 )
2024-12-18 19:27:59 -08:00
Jarred Sumner
20f9cf0047
Fix flaky signal handlers on posix ( #15751 )
2024-12-13 20:13:56 -08:00
dave caruso
b39632c921
feat: new binding generator ( #15638 )
2024-12-10 12:43:17 -08:00
pfg
f9efe94b85
Fixes ^C on bun vite ( #15545 )
2024-12-04 12:39:55 -08:00
pfg
78b495aff5
fix \uFFFF printing regression ( #15330 )
...
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com >
2024-11-21 22:01:27 -08:00
pfg
95fcee8b76
Fix expect toMatchSnapshot not working for some strings ( #15183 )
2024-11-21 17:46:45 -08:00
Pham Minh Triet
144db9ca52
Fix typo in 15276.test.ts ( #15304 )
2024-11-20 19:11:12 -08:00
Jarred Sumner
a6a4ca1e49
fix(install): ensure aliases hash map is initialized ( #15280 )
...
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com >
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com >
2024-11-20 18:52:34 -08:00
pfg
8a0666acd1
Fix setTimeout with node:util.promisify ( #15230 )
2024-11-18 19:29:55 -08:00
pfg
56f7c8887b
Fix unicode imports, unicode-escaped variable names, and printClauseAlias not working for utf-8 ( #15009 )
2024-11-11 13:27:42 -08:00
Christophe Eymard
fc071d3362
remove checks for self closing tags ( #14990 )
2024-11-06 14:58:31 -08:00
pfg
497fa59bf0
Fix #14865 ( #14953 )
2024-11-02 17:13:31 -07:00
pfg
698e87aa67
Fix #14187 ( #14884 )
2024-10-28 18:11:03 -07:00