Skip to content

Commit

Permalink
Fix buffer check in output_csv_fast.c
Browse files Browse the repository at this point in the history
  • Loading branch information
phaag authored Jul 29, 2024
1 parent cc0f593 commit 266b960
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/output/output_csv_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 266b960

Please sign in to comment.