From 09648f6cf1a8db5640a8e25e1be8c6a6c69c4f7a Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Mon, 1 Sep 2014 19:03:16 +0900 Subject: [PATCH] embryo_cc - fix possible buffer overrun fix CID 1039589 --- src/bin/embryo/embryo_cc_sc1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c index 6432b5599d..b97e199950 100644 --- a/src/bin/embryo/embryo_cc_sc1.c +++ b/src/bin/embryo/embryo_cc_sc1.c @@ -3030,7 +3030,8 @@ insert_constval(constvalue * prev, constvalue * next, char *name, if (!(cur = (constvalue *)malloc(sizeof(constvalue)))) error(103); /* insufficient memory (fatal error) */ memset(cur, 0, sizeof(constvalue)); - strcpy(cur->name, name); + strncpy(cur->name, name, sizeof(cur->name) - 1); + cur->name[sizeof(cur->name) - 1] = 0; cur->value = val; cur->index = idx; cur->next = next;