From: David Woodhouse Date: Wed, 19 May 2021 08:31:31 +0000 (+0100) Subject: Validate line_len argument to buf_append_base64() too X-Git-Tag: v8.20~171 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=51ff522c91defacb0aecbea77fef56ff61dfac03;p=users%2Fdwmw2%2Fopenconnect.git Validate line_len argument to buf_append_base64() too Based on a patch by Tom Carroll Signed-off-by: David Woodhouse --- diff --git a/textbuf.c b/textbuf.c index 62f279d2..dc9a32e5 100644 --- a/textbuf.c +++ b/textbuf.c @@ -418,7 +418,7 @@ void buf_append_base64(struct oc_text_buf *buf, const void *bytes, int len, if (!buf || buf->error) return; - if (len < 0) { + if (len < 0 || line_len < 0 || (line_len % 3)) { buf->error = -EINVAL; return; }