summaryrefslogtreecommitdiffstats
path: root/sbin/routed/table.c
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-03-30 01:50:15 +0000
committershin <shin@FreeBSD.org>2000-03-30 01:50:15 +0000
commit02a6f15567557da3c44026be5727cd3a84cc1ecf (patch)
treea30db9b00e556d3a3cae2ae8f83498baf51897a7 /sbin/routed/table.c
parent5bc92eac721d018ebd8bce5e87f57294ccb0fd54 (diff)
downloadFreeBSD-src-02a6f15567557da3c44026be5727cd3a84cc1ecf.zip
FreeBSD-src-02a6f15567557da3c44026be5727cd3a84cc1ecf.tar.gz
Prevent buffer overflow.
PR: bin/17657 Submitted by: tanimura
Diffstat (limited to 'sbin/routed/table.c')
-rw-r--r--sbin/routed/table.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/routed/table.c b/sbin/routed/table.c
index b7e826e..d7bab2f 100644
--- a/sbin/routed/table.c
+++ b/sbin/routed/table.c
@@ -617,6 +617,7 @@ ag_check(naddr dst,
}
+#define NAME0_LEN 14
static const char *
rtm_type_name(u_char type)
{
@@ -636,12 +637,12 @@ rtm_type_name(u_char type)
"RTM_DELADDR",
"RTM_IFINFO"
};
- static char name0[10];
+ static char name0[NAME0_LEN];
if (type > sizeof(rtm_types)/sizeof(rtm_types[0])
|| type == 0) {
- sprintf(name0, "RTM type %#x", type);
+ snprintf(name0, NAME0_LEN, "RTM type %#x", type);
return name0;
} else {
return rtm_types[type-1];
OpenPOWER on IntegriCloud