mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-24 16:25:20 +00:00
fix: alloc free off by one (#8886)
Fix provided by @jcollie The swift `open_config` action was triggering an allocation error `error(gpa): Allocation size 41 bytes does not match free size 40.`. > A string that was created as a `[:0]const u8` was cast to `[]const u8` and then freed. The sentinel is the off-by-one. @jcollie For full context, see https://discord.com/channels/1005603569187160125/1420367156071239820 Co-authored-by: Jeffrey C. Ollie <jcollie@dmacc.edu>
This commit is contained in:
@@ -353,6 +353,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
const char* ptr;
|
||||
uintptr_t len;
|
||||
bool sentinel;
|
||||
} ghostty_string_s;
|
||||
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user