From 4ca7c740a6fdad925acf1dd67eefa6e5a4dd8b74 Mon Sep 17 00:00:00 2001 From: Sheldon Hearn Date: Sun, 20 Feb 2000 09:08:33 +0000 Subject: [PATCH] Fix buffer overrun in pcfclock_read(). The submitter is the original author of the affected code. PR: 16552 Submitted by: Sascha Schumann Approved by: jkh --- sys/dev/ppbus/pcfclock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/ppbus/pcfclock.c b/sys/dev/ppbus/pcfclock.c index a52ff82420d..9101638d83f 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) {