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) {