mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-27 10:33:09 +01:00
Don't write into buffer if no arguments, reported by Filipe Rosset.
This commit is contained in:
parent
6d9f936ff2
commit
0bb9d51965
3
cmd.c
3
cmd.c
@ -138,6 +138,9 @@ cmd_pack_argv(int argc, char **argv, char *buf, size_t len)
|
|||||||
size_t arglen;
|
size_t arglen;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (argc == 0)
|
||||||
|
return (0);
|
||||||
|
|
||||||
*buf = '\0';
|
*buf = '\0';
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
if (strlcpy(buf, argv[i], len) >= len)
|
if (strlcpy(buf, argv[i], len) >= len)
|
||||||
|
Loading…
Reference in New Issue
Block a user