Commit Diff


commit - 541417a8ab273253821d28ba990814d1042d2e43
commit + 90cee84d4c2eb546ed31ba65a01289429ea7f544
blob - a2af7b41b75ae6335ab275bdd2ece8c3515aa765
blob + d724dfcc078b9eea124e9cadc88f0f030e5243ea
--- kamid/table_static.c
+++ kamid/table_static.c
@@ -85,12 +85,14 @@ table_static_add(struct table *t, const char *key, con
 {
 	struct kp	*kp;
 	unsigned int	 slot;
+	size_t		 len;
 
 	if (key == NULL)
 		return -1;
 
-	kp = xcalloc(1, sizeof(*kp) + strlen(key) + 1);
-	strcpy(kp->key, key);
+	len = strlen(key) + 1;
+	kp = xcalloc(1, sizeof(*kp) + len);
+	memcpy(kp->key, key, len);
 	if (val != NULL)
 		kp->val = xstrdup(val);