diff options
author | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2022-08-30 15:57:20 +0000 |
---|---|---|
committer | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2022-08-30 15:57:20 +0000 |
commit | fa668d62a7472d839c43e64a62618f74d13c1b1b (patch) | |
tree | b650bee2f4212040561325863eb595023a187174 /usr.bin | |
parent | 0e9c1d02bdcabe1827818d077b497e8dc1cbd8e5 (diff) |
Give a string which length is multiple of 4 to b64_pton() since the
function assumes that the input ends at end of 24-bit group.
ok tb claudio
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/uudecode/uudecode.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c index ad89732b0bd..186ab614ba8 100644 --- a/usr.bin/uudecode/uudecode.c +++ b/usr.bin/uudecode/uudecode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uudecode.c,v 1.27 2019/06/28 13:35:05 deraadt Exp $ */ +/* $OpenBSD: uudecode.c,v 1.28 2022/08/30 15:57:19 yasuoka Exp $ */ /* $FreeBSD: uudecode.c,v 1.49 2003/05/03 19:44:46 obrien Exp $ */ /*- @@ -423,11 +423,13 @@ uu_decode(void) } } +#define ROUNDDOWN(x,y) (((x)/(y)) * (y)) + static int base64_decode(void) { int n; - char inbuf[PATH_MAX]; + char inbuf[ROUNDDOWN(PATH_MAX, 4) + 1]; unsigned char outbuf[PATH_MAX * 4]; for (;;) { |