From 9e8b78eb15ca81518e6dfd95244253388ca5cf81 Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser hiddenalpha.ch Date: Fri, 11 Oct 2024 16:46:35 +0200 Subject: Fix bug of bad length. --- src/bulk_ln/bulk_ln.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/bulk_ln/bulk_ln.c b/src/bulk_ln/bulk_ln.c index ae9e51c..9b7c7ca 100644 --- a/src/bulk_ln/bulk_ln.c +++ b/src/bulk_ln/bulk_ln.c @@ -350,7 +350,7 @@ static int parseDataFileAsPairPerLine( BulkLn*bulkLn ){ bulkLn->dataFilePath, lineNum); err = -1; goto finally; } - char *unwantedTab = memchr(tab + 1, DATA_FILE_FIELD_SEP_CHR, tab + 1 - buf); + char *unwantedTab = memchr(tab + 1, DATA_FILE_FIELD_SEP_CHR, buf_len - (tab - buf + 2)); if( unwantedTab != NULL ){ fprintf(stderr, "Too many field separators (tab) in '%s' @ %lu\n", bulkLn->dataFilePath, lineNum); -- cgit v1.1