Commit Graph

4 Commits

Author SHA1 Message Date
Dean ee364bf05f
Merge pull request #2324 from AchrafReyani/fix/libc-getcwd-application-heap
fix(libc): allocate getcwd's buffer from the application heap
2026-10-10 17:46:55 +13:00
MarcZX100 d809ccf797 test(libc): cover getcwd zero-size buffer 2026-10-09 17:38:45 +00:00
Achraf Reyani d8c5d142b6 fix(libc): allocate getcwd's buffer from the application heap
getcwd(NULL, size) returned memory from the guest heap directly, while
the caller frees it with free(), which goes to the application heap.
With a title's malloc replacement registered, that free reached the
replacement with a pointer it never returned. Allocate from the
application heap like strdup, and report ENOMEM when it returns null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 00:26:48 +09:00
SamG-Coder 1b45b0fe68 feat(libc): track guest working directory and resolve relative paths 2026-09-25 06:51:37 +10:00