Skip to content

fix: segfault when getcwd is called with null buf#5

Merged
Thesola10 merged 1 commit intonixie-dev:mainfrom
cassandracomar:main
Aug 12, 2024
Merged

fix: segfault when getcwd is called with null buf#5
Thesola10 merged 1 commit intonixie-dev:mainfrom
cassandracomar:main

Conversation

@cassandracomar
Copy link
Copy Markdown

ruby and I'm guessing other apps pass a null buffer to getcwd, expecting to use the return value rather than having data written into the destination buffer. this obviously causes an illegal access. this patch fixes it by having fakedir's getcwd check if the destination buffer is valid and allocating a new buffer with strdup if it isn't.

ruby and I'm guessing other apps pass a null buffer to getcwd, expecting
to use the return value rather than having data written into the
destination buffer. this obviously causes an illegal access. this patch
fixes it by having fakedir's getcwd check if the destination buffer is
valid and allocating a new buffer with strdup if it isn't.
@Thesola10 Thesola10 merged commit a2bd8d0 into nixie-dev:main Aug 12, 2024
Thesola10 added a commit to nixie-dev/nixie that referenced this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants