summaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
authornicm <nicm>2023-06-30 13:19:32 +0000
committernicm <nicm>2023-06-30 13:19:32 +0000
commit4e57894e8506f27844fc0e6353475a0b61fd7807 (patch)
tree546735d921e538f5e594c0ff79b4d46a7be7b364 /input.c
parent2546216019efcbb37bfa67ba8ac101c49d42c48b (diff)
Get rid of some warnings with GCC 10, from Thomas Klausner.
Diffstat (limited to 'input.c')
-rw-r--r--input.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/input.c b/input.c
index b2d28386..dd22ac75 100644
--- a/input.c
+++ b/input.c
@@ -2842,9 +2842,11 @@ input_reply_clipboard(struct bufferevent *bev, const char *buf, size_t len,
const char *end)
{
char *out = NULL;
- size_t outlen = 0;
+ int outlen = 0;
if (buf != NULL && len != 0) {
+ if (len >= ((size_t)INT_MAX * 3 / 4) - 1)
+ return;
outlen = 4 * ((len + 2) / 3) + 1;
out = xmalloc(outlen);
if ((outlen = b64_ntop(buf, len, out, outlen)) == -1) {