summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bind/lib/isccfg/parser.c
diff options
context:
space:
mode:
authorjakob <jakob@openbsd.org>2003-04-15 13:20:17 +0000
committerjakob <jakob@openbsd.org>2003-04-15 13:20:17 +0000
commitf750bd748124bcc2acdee22a1508c390eaf89784 (patch)
tree052d6b96325b1f923e3a7ac3de904181cf8db133 /usr.sbin/bind/lib/isccfg/parser.c
parentdisplay basic hfsc stats (diff)
downloadwireguard-openbsd-f750bd748124bcc2acdee22a1508c390eaf89784.tar.xz
wireguard-openbsd-f750bd748124bcc2acdee22a1508c390eaf89784.zip
first sprintf pass from todd@ and ISC-Bugs #5614.
Diffstat (limited to 'usr.sbin/bind/lib/isccfg/parser.c')
-rw-r--r--usr.sbin/bind/lib/isccfg/parser.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/bind/lib/isccfg/parser.c b/usr.sbin/bind/lib/isccfg/parser.c
index 9bad2b1541d..84c0a1b7fb3 100644
--- a/usr.sbin/bind/lib/isccfg/parser.c
+++ b/usr.sbin/bind/lib/isccfg/parser.c
@@ -1649,7 +1649,8 @@ parse_unitstring(char *str, isc_resourcevalue_t *valuep) {
static void
print_uint64(cfg_printer_t *pctx, cfg_obj_t *obj) {
char buf[32];
- sprintf(buf, "%" ISC_PRINT_QUADFORMAT "u", obj->value.uint64);
+ snprintf(buf, sizeof(buf), "%" ISC_PRINT_QUADFORMAT "u",
+ obj->value.uint64);
print_cstr(pctx, buf);
}
@@ -3646,13 +3647,16 @@ parser_complain(cfg_parser_t *pctx, isc_boolean_t is_warning,
static char message[2048];
int level = ISC_LOG_ERROR;
const char *prep = "";
+ size_t len;
if (is_warning)
level = ISC_LOG_WARNING;
- sprintf(where, "%s:%u: ", current_file(pctx), pctx->line);
+ snprintf(where, sizeof(where), "%s:%u: ",
+ current_file(pctx), pctx->line);
- if ((unsigned int)vsprintf(message, format, args) >= sizeof message)
+ len = vsnprintf(message, sizeof(message), format, args);
+ if (len >= sizeof(message))
FATAL_ERROR(__FILE__, __LINE__,
"error message would overflow");