summaryrefslogtreecommitdiff
path: root/usr.sbin/eeprom/eehandlers.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-31 12:56:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-31 12:56:09 +0000
commit5107a4b7e22f40b117536853264ff985555e9a02 (patch)
treed76c6873ebe74863e4f4b578e79a06c3211c288e /usr.sbin/eeprom/eehandlers.c
parent6a142e81fcb2c69c6777c6d44292508865f22bfa (diff)
buf oflow in some more "NetBSD Foundation" code
Diffstat (limited to 'usr.sbin/eeprom/eehandlers.c')
-rw-r--r--usr.sbin/eeprom/eehandlers.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/eeprom/eehandlers.c b/usr.sbin/eeprom/eehandlers.c
index 559c8b44e88..6a192c1e407 100644
--- a/usr.sbin/eeprom/eehandlers.c
+++ b/usr.sbin/eeprom/eehandlers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eehandlers.c,v 1.4 1996/08/31 12:42:49 deraadt Exp $ */
+/* $OpenBSD: eehandlers.c,v 1.5 1996/08/31 12:56:06 deraadt Exp $ */
/* $NetBSD: eehandlers.c,v 1.2 1996/02/28 01:13:22 thorpej Exp $ */
/*-
@@ -504,22 +504,22 @@ doio(ktent, buf, len, wr)
fd = open(path_eeprom, wr == IO_WRITE ? O_RDWR : O_RDONLY, 0640);
if (fd < 0) {
- sprintf(err_str, "open: %s: %s", path_eeprom,
+ snprintf(err_str, sizeof err_str, "open: %s: %s", path_eeprom,
strerror(errno));
free(buf2);
return (1);
}
if (lseek(fd, (off_t)ktent->kt_offset, SEEK_SET) < (off_t)0) {
- sprintf(err_str, "lseek: %s:", path_eeprom,
+ snprintf(err_str, sizeof err_str, "lseek: %s: %s", path_eeprom,
strerror(errno));
rval = 1;
goto done;
}
if (read(fd, buf2, len) != len) {
- sprintf(err_str, "read: %s: %s", path_eeprom,
- strerror(errno));
+ snprintf(err_str, sizeof err_str, "read: %s: %s", path_eeprom,
+ strerror(errno));
return (1);
}
@@ -528,16 +528,16 @@ doio(ktent, buf, len, wr)
goto done;
if (lseek(fd, (off_t)ktent->kt_offset, SEEK_SET) < (off_t)0) {
- sprintf(err_str, "lseek: %s: %s", path_eeprom,
- strerror(errno));
+ snprintf(err_str, sizeof err_str, "lseek: %s: %s",
+ path_eeprom, strerror(errno));
rval = 1;
goto done;
}
++update_checksums;
if (write(fd, buf, len) < 0) {
- sprintf(err_str, "write: %s: %s", path_eeprom,
- strerror(errno));
+ snprintf(err_str, sizeof err_str, "write: %s: %s",
+ path_eeprom, strerror(errno));
rval = 1;
goto done;
}