summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-05-12 21:48:35 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-05-12 21:48:35 +0000
commitb61d1c77a11f0f3bf964cc9dccd0644e31d38eb5 (patch)
tree2e906e79d92a99ae8ecf28f9fd27cd9c812cd0bb /usr.sbin/bind/lib
parentdd1bc69911513e255f1002ba8dd6a86c24408529 (diff)
sprintf -> snprintf. ok krw@ deraadt@
Diffstat (limited to 'usr.sbin/bind/lib')
-rw-r--r--usr.sbin/bind/lib/isc/inet_ntop.c3
-rw-r--r--usr.sbin/bind/lib/isc/log.c8
-rw-r--r--usr.sbin/bind/lib/lwres/lwinetntop.c3
3 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/bind/lib/isc/inet_ntop.c b/usr.sbin/bind/lib/isc/inet_ntop.c
index dc121e6c3f9..8c919e71a29 100644
--- a/usr.sbin/bind/lib/isc/inet_ntop.c
+++ b/usr.sbin/bind/lib/isc/inet_ntop.c
@@ -173,7 +173,8 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
tp += strlen(tp);
break;
}
- tp += sprintf(tp, "%x", words[i]);
+ snprintf(tp, tmp + sizeof tmp - tp, "%x", words[i]);
+ tp += strlen(tp);
}
/* Was it a trailing run of 0x00's? */
if (best.base != -1 && (best.base + best.len) ==
diff --git a/usr.sbin/bind/lib/isc/log.c b/usr.sbin/bind/lib/isc/log.c
index 81cb805fbb4..f2de1c42d67 100644
--- a/usr.sbin/bind/lib/isc/log.c
+++ b/usr.sbin/bind/lib/isc/log.c
@@ -1232,7 +1232,7 @@ roll_log(isc_logchannel_t *channel) {
* Remove any excess logs on the way to that value.
*/
while (--greatest >= FILE_VERSIONS(channel)) {
- sprintf(current, "%s.%d", path, greatest);
+ snprintf(current, sizeof current, "%s.%d", path, greatest);
(void)remove(current);
}
@@ -1252,13 +1252,13 @@ roll_log(isc_logchannel_t *channel) {
return (ISC_R_INVALIDFILE);
for (i = greatest; i > 0; i--) {
- sprintf(current, "%s.%d", path, i - 1);
- sprintf(new, "%s.%d", path, i);
+ snprintf(current, sizeof current, "%s.%d", path, i - 1);
+ snprintf(new, sizeof new, "%s.%d", path, i);
(void)isc_file_rename(current, new);
}
if (FILE_VERSIONS(channel) != 0) {
- sprintf(new, "%s.0", path);
+ snprintf(new, sizeof new, "%s.0", path);
(void)isc_file_rename(path, new);
} else if (FILE_VERSIONS(channel) == 0)
diff --git a/usr.sbin/bind/lib/lwres/lwinetntop.c b/usr.sbin/bind/lib/lwres/lwinetntop.c
index 0f58009031c..071eb83efe6 100644
--- a/usr.sbin/bind/lib/lwres/lwinetntop.c
+++ b/usr.sbin/bind/lib/lwres/lwinetntop.c
@@ -171,7 +171,8 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size) {
tp += strlen(tp);
break;
}
- tp += sprintf(tp, "%x", words[i]); /* XXX */
+ snprintf(tp, tmp + sizeof tmp - tp, "%x", words[i]);
+ tp += strlen(tp);
}
/* Was it a trailing run of 0x00's? */
if (best.base != -1 && (best.base + best.len) ==