summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus/pcfclock.c
diff options
context:
space:
mode:
authorsheldonh <sheldonh@FreeBSD.org>2000-02-20 09:08:33 +0000
committersheldonh <sheldonh@FreeBSD.org>2000-02-20 09:08:33 +0000
commit409e21443fb6684d8afa2a4fde37311958e8885d (patch)
tree8828d88f508d786a238eac60b05f4bff49e43fc6 /sys/dev/ppbus/pcfclock.c
parent43fdccee10fb43365674c5b1e3864005139e9ceb (diff)
downloadFreeBSD-src-409e21443fb6684d8afa2a4fde37311958e8885d.zip
FreeBSD-src-409e21443fb6684d8afa2a4fde37311958e8885d.tar.gz
Fix buffer overrun in pcfclock_read(). The submitter is the original
author of the affected code. PR: 16552 Submitted by: Sascha Schumann <sascha@schumann.cx> Approved by: jkh
Diffstat (limited to 'sys/dev/ppbus/pcfclock.c')
-rw-r--r--sys/dev/ppbus/pcfclock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/ppbus/pcfclock.c b/sys/dev/ppbus/pcfclock.c
index a52ff82..9101638 100644
--- a/sys/dev/ppbus/pcfclock.c
+++ b/sys/dev/ppbus/pcfclock.c
@@ -312,6 +312,9 @@ pcfclock_read(dev_t dev, struct uio *uio, int ioflag)
char buf[18];
int error = 0;
+ if (uio->uio_resid < 18)
+ return (ERANGE);
+
error = pcfclock_read_dev(dev, buf, PCFCLOCK_MAX_RETRIES);
if (error) {
OpenPOWER on IntegriCloud