diff options
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/sparc64/openprom.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/openprom.c b/sys/arch/sparc64/sparc64/openprom.c index cecd008897c..33c022f5ab3 100644 --- a/sys/arch/sparc64/sparc64/openprom.c +++ b/sys/arch/sparc64/sparc64/openprom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openprom.c,v 1.19 2015/02/10 21:56:09 miod Exp $ */ +/* $OpenBSD: openprom.c,v 1.20 2015/02/11 01:14:06 miod Exp $ */ /* $NetBSD: openprom.c,v 1.4 2002/01/10 06:21:53 briggs Exp $ */ /* @@ -99,6 +99,9 @@ openpromread(dev_t dev, struct uio *uio, int flags) if (minor(dev) != 1) return (ENXIO); + if (uio->uio_offset < 0) + return (EINVAL); + while (uio->uio_resid > 0) { if (uio->uio_offset >= mdesc_len) break; @@ -108,7 +111,7 @@ openpromread(dev_t dev, struct uio *uio, int flags) if (len > uio->uio_resid) len = uio->uio_resid; - error = uiomovei(v, len, uio); + error = uiomove(v, len, uio); if (error) return (error); } |