diff options
author | Kamil Dudka <kdudka@redhat.com> | 2018-11-07 14:04:53 +0100 |
---|---|---|
committer | Peter Stephenson <p.stephenson@samsung.com> | 2018-11-09 10:57:09 +0000 |
commit | 031afe420725e328e9d7742be69ef0bd81c62b9a (patch) | |
tree | 9fd57761e82fd34dea8dc0afecc47ccf5dbad213 /Src/Zle/computil.c | |
parent | a8cc017c74a916b690dc074c299faf4bd24b5af4 (diff) | |
download | zsh-031afe420725e328e9d7742be69ef0bd81c62b9a.tar.gz zsh-031afe420725e328e9d7742be69ef0bd81c62b9a.tar.xz zsh-031afe420725e328e9d7742be69ef0bd81c62b9a.zip |
43793: computil could overrun buffer
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r-- | Src/Zle/computil.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index 5526e0ad0..cb1c01042 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -561,9 +561,9 @@ cd_init(char *nam, char *hide, char *mlen, char *sep, if (str->str == str->match) str->str = ztrdup(str->str); if (hide[1] && str->str[0] == '-' && str->str[1] == '-') - strcpy(str->str, str->str + 2); + memmove(str->str, str->str + 2, strlen(str->str) - 1); else if (str->str[0] == '-' || str->str[0] == '+') - strcpy(str->str, str->str + 1); + memmove(str->str, str->str + 1, strlen(str->str)); } } for (ap = args; *args && |