From 7a278ef035fd061291062814541b1e6812890809 Mon Sep 17 00:00:00 2001 From: jsteube Date: Sun, 17 Sep 2017 12:14:52 +0200 Subject: [PATCH] Fix overflow in out_push() --- include/types.h | 2 +- src/stdout.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/types.h b/include/types.h index 4037edf2d..244215a7f 100644 --- a/include/types.h +++ b/include/types.h @@ -1396,7 +1396,7 @@ typedef struct out { FILE *fp; - char buf[BUFSIZ]; + char buf[HCBUFSIZ_TINY]; int len; } out_t; diff --git a/src/stdout.c b/src/stdout.c index 91c43f287..dd3e02d66 100644 --- a/src/stdout.c +++ b/src/stdout.c @@ -44,7 +44,7 @@ static void out_push (out_t *out, const u8 *pw_buf, const int pw_len) #endif - if (out->len >= BUFSIZ - 100) + if (out->len >= HCBUFSIZ_TINY - 300) { out_flush (out); }