ctty
ctty copied to clipboard
ctty_get_name(): fix buffer overrun due to incorrect use of strncpy()
strncpy() will zero-fill the destination up to the size passed - MAX_PATH_LEN, but we only malloc() the actual size of the string, so this overruns and causes heap corruption.
I don't fully understand your approach to string handling, but it seems far easier just to use strdup() here!
Fixes: https://github.com/emptymonkey/shelljack/issues/3