blinksh / blink

Blink Mobile Shell for iOS (Mosh based)
https://blink.sh
GNU General Public License v3.0
6.15k stars 576 forks source link

Assert session args is valid UTF-8 #1900

Closed l2dy closed 7 months ago

l2dy commented 10 months ago

If it is NULL, null pointer dereferencing in makeargs() would result in undefined behavior. https://developer.apple.com/documentation/xcode/null-reference-creation-and-null-pointer-dereference

l2dy commented 7 months ago

UTF-8 was a red herring. It's makeargs() that should check if command is NULL before dereferencing *str.