summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ospfd/ospf_lsa.c9
-rw-r--r--ospfd/ospf_te.c2
2 files changed, 6 insertions, 5 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 74d5178f55..4e67694059 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -284,12 +284,12 @@ const char *dump_lsa_key(struct ospf_lsa *lsa)
if (lsa != NULL && (lsah = lsa->data) != NULL) {
char id[INET_ADDRSTRLEN], ar[INET_ADDRSTRLEN];
- strcpy(id, inet_ntoa(lsah->id));
- strcpy(ar, inet_ntoa(lsah->adv_router));
+ strlcpy(id, inet_ntoa(lsah->id), sizeof(id));
+ strlcpy(ar, inet_ntoa(lsah->adv_router), sizeof(ar));
sprintf(buf, "Type%d,id(%s),ar(%s)", lsah->type, id, ar);
} else
- strcpy(buf, "NULL");
+ strlcpy(buf, "NULL", sizeof(buf));
return buf;
}
@@ -2713,7 +2713,8 @@ struct ospf_lsa *ospf_lsa_install(struct ospf *ospf, struct ospf_interface *oi,
new->data->type, NULL));
break;
default:
- strcpy(area_str, inet_ntoa(new->area->area_id));
+ strlcpy(area_str, inet_ntoa(new->area->area_id),
+ sizeof(area_str));
zlog_debug("LSA[%s]: Install %s to Area %s",
dump_lsa_key(new),
lookup_msg(ospf_lsa_type_msg,
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index b13e833afd..253b272df6 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -1252,7 +1252,7 @@ static int ospf_mpls_te_lsa_originate1(struct ospf_area *area,
if (IS_DEBUG_OSPF(lsa, LSA_GENERATE)) {
char area_id[INET_ADDRSTRLEN];
- strcpy(area_id, inet_ntoa(area->area_id));
+ strlcpy(area_id, inet_ntoa(area->area_id), sizeof(area_id));
zlog_debug(
"LSA[Type%d:%s]: Originate Opaque-LSA/MPLS-TE: Area(%s), Link(%s)",
new->data->type, inet_ntoa(new->data->id), area_id,