summaryrefslogtreecommitdiff
path: root/ospfd/ospf_lsa.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-10-24 19:36:30 -0400
committerGitHub <noreply@github.com>2017-10-24 19:36:30 -0400
commitb5b583aa8d9318a36a89129b08dee7f9fdedcf68 (patch)
tree55ddd237d50698bc0a53a42b41def519b337c935 /ospfd/ospf_lsa.c
parent47473bbbc7cc919eace33812419c0eb76e4cda68 (diff)
parentb11b57723b963fb5d0ab11748b7957f0b7fa5d37 (diff)
Merge pull request #1357 from opensourcerouting/coverity_fixes
Coverity fixes
Diffstat (limited to 'ospfd/ospf_lsa.c')
-rw-r--r--ospfd/ospf_lsa.c9
1 files changed, 5 insertions, 4 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,