From: yasuoka Date: Tue, 30 Aug 2022 15:57:19 +0000 (+0000) Subject: Give a string which length is multiple of 4 to b64_pton() since the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9952f79b7732792b0aace5870871cf7d3be9ece7;p=openbsd 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 --- 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 (;;) {