summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/config.y
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-12-14 19:44:13 +0000
committerjoerg <joerg@FreeBSD.org>1996-12-14 19:44:13 +0000
commit000a733206a490453542c9e437941673ec57912a (patch)
tree3f6b1c56b332fa464f32c498675cd4b15bef6ee2 /usr.sbin/config/config.y
parent9395a75d3036be477ebade57b19f2db19bea8b82 (diff)
downloadFreeBSD-src-000a733206a490453542c9e437941673ec57912a.zip
FreeBSD-src-000a733206a490453542c9e437941673ec57912a.tar.gz
Round #1 of cleaning up the config(8) mess. This is only the more
conservative part of the tidyup, like fixing potential buffer overflow conditions. It is believed to be safe to go into 2.2. Pointed out by: lozenko@cc.acnit.ac.ru (Evgeny A. Lozenko)
Diffstat (limited to 'usr.sbin/config/config.y')
-rw-r--r--usr.sbin/config/config.y9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y
index 7658111..91fbf24 100644
--- a/usr.sbin/config/config.y
+++ b/usr.sbin/config/config.y
@@ -358,28 +358,29 @@ device_name:
= {
char buf[80];
- (void) sprintf(buf, "%s%d", $1, $2);
+ (void) snprintf(buf, 80, "%s%d", $1, $2);
$$ = ns(buf); free($1);
}
| Save_id NUMBER ID
= {
char buf[80];
- (void) sprintf(buf, "%s%d%s", $1, $2, $3);
+ (void) snprintf(buf, 80, "%s%d%s", $1, $2, $3);
$$ = ns(buf); free($1);
}
| Save_id NUMBER ID NUMBER
= {
char buf[80];
- (void) sprintf(buf, "%s%d%s%d", $1, $2, $3, $4);
+ (void) snprintf(buf, 80, "%s%d%s%d", $1, $2, $3, $4);
$$ = ns(buf); free($1);
}
| Save_id NUMBER ID NUMBER ID
= {
char buf[80];
- (void) sprintf(buf, "%s%d%s%d%s", $1, $2, $3, $4, $5);
+ (void) snprintf(buf, 80, "%s%d%s%d%s",
+ $1, $2, $3, $4, $5);
$$ = ns(buf); free($1);
}
;
OpenPOWER on IntegriCloud