diff options
author | Emmanuel Nicolet <emmanuel.nicolet@gmail.com> | 2019-12-26 21:02:37 +0100 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-12-28 15:06:41 -0600 |
commit | bd07fbb1d559d16caae22ae44e78d02b2cc3595e (patch) | |
tree | 2191b738fbdcc060edaea6cc4585373514ea3440 /toys | |
parent | 4817036313bde019e4639bf52e7a6c52ca715c61 (diff) | |
download | toybox-bd07fbb1d559d16caae22ae44e78d02b2cc3595e.tar.gz |
tar: fix memory write error
Clear the last byte of the allocated buffer.
Diffstat (limited to 'toys')
-rw-r--r-- | toys/posix/tar.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/tar.c b/toys/posix/tar.c index 1e662589..0327c894 100644 --- a/toys/posix/tar.c +++ b/toys/posix/tar.c @@ -169,7 +169,7 @@ static void alloread(void *buf, int len) free(*b); *b = xmalloc(len+1); xreadall(TT.fd, *b, len); - b[len] = 0; + ((char*)(*b))[len] = 0; } // callback from dirtree to create archive |