summaryrefslogtreecommitdiff
path: root/lib/csv.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csv.c')
-rw-r--r--lib/csv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/csv.c b/lib/csv.c
index fdd89a0c7a..2cd0092f0a 100644
--- a/lib/csv.c
+++ b/lib/csv.c
@@ -573,7 +573,7 @@ void csv_decode(csv_t *csv, char *inbuf)
log_error("field str malloc failed\n");
return;
}
- strncpy(rec->record, buf, pos - buf + 1);
+ memcpy(rec->record, buf, MIN(pos - buf + 1, csv->buflen - 1));
}
rec->rec_len = pos - buf + 1;
/* decode record into fields */