From 1120b9596aaf53399d4739dedb016c731c85f654 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Fri, 17 Apr 2020 20:05:34 -0400 Subject: [PATCH] lib: don't use strcpy >:( Signed-off-by: Quentin Young --- lib/csv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/csv.c b/lib/csv.c index 445742807c..45ace9777c 100644 --- a/lib/csv.c +++ b/lib/csv.c @@ -1,5 +1,5 @@ /* CSV - * Copyright (C) 2013 Cumulus Networks, Inc. + * Copyright (C) 2013,2020 Cumulus Networks, Inc. * * This file is part of Quagga. * @@ -22,6 +22,8 @@ #include "config.h" #endif +#include + #include #include #include @@ -419,7 +421,7 @@ void csv_clone_record(csv_t *csv, csv_record_t *in_rec, csv_record_t **out_rec) } rec->record = curr; rec->rec_len = in_rec->rec_len; - strcpy(rec->record, in_rec->record); + strlcpy(rec->record, in_rec->record, csv->buflen); /* decode record into fields */ csv_decode_record(rec);