diff options
author | Václav Doležal <vdolezal@redhat.com> | 2018-11-07 16:10:33 +0100 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2018-11-18 16:01:00 +0100 |
commit | 26e61437ef70d728f6030f3b12da2493753044e7 (patch) | |
tree | 07d82d046a7079ad5e2fb7c1495d9a32f078e054 | |
parent | 61d6955517173040b0bc096a9284493e0ad31a1b (diff) | |
download | screen-26e61437ef70d728f6030f3b12da2493753044e7.tar.gz |
Fix possible unterminated string
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net
-rw-r--r-- | src/pty.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -279,7 +279,13 @@ char **ttyn; return -1; } signal(SIGCHLD, sigcld); - strncpy(TtyName, m, sizeof(TtyName)); + if (strlen(m) < sizeof(TtyName)) + strcpy(TtyName, m); + else + { + close(f); + return -1; + } initmaster(f); *ttyn = TtyName; return f; |