From 266b960cb264463b3ec78f2456f6becc987c5377 Mon Sep 17 00:00:00 2001 From: Peter Haag Date: Mon, 29 Jul 2024 15:56:17 +0200 Subject: [PATCH] Fix buffer check in output_csv_fast.c --- src/output/output_csv_fast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output/output_csv_fast.c b/src/output/output_csv_fast.c index 9e6a385b..0fc0936e 100644 --- a/src/output/output_csv_fast.c +++ b/src/output/output_csv_fast.c @@ -154,7 +154,7 @@ void csv_record_fast(FILE *stream, recordHandle_t *recordHandle, int tag) { *--streamPtr = '\n'; *++streamPtr = '\0'; - if (unlikely((streamPtr - buff) > BUFFSIZE)) { + if (unlikely((buff + BUFFSIZE - streamPtr) < 100)) { LogError("csv_record_fast() error in %s line %d: %s", __FILE__, __LINE__, "memory corruption"); exit(EXIT_FAILURE); }