jnr / jnr-posix

Java Posix layer
Other
241 stars 91 forks source link

Defensive copy of posix_spawn file paths #171

Closed headius closed 3 years ago

headius commented 3 years ago

Works around systems that haven't fixed CVE-2014-4043.

See https://bugzilla.redhat.com/show_bug.cgi?id=1983750

headius commented 3 years ago

Regarding the native encoding of the path into the buffer, questioned in @fweimer-rh's review... I believe this is the correct way.

The null terminator length is debateable but I'm pretty sure the Java code here for encoding the path matches what the equivalent JNI-based filesystem APIs would do.