-/* $OpenBSD: bpp.c,v 1.4 2003/06/03 21:09:02 deraadt Exp $ */
+/* $OpenBSD: bpp.c,v 1.5 2010/08/06 00:00:38 miod Exp $ */
/*
* Copyright (c) 1997, Jason Downs. All rights reserved.
int error = 0;
while ((n = min(BPP_BSIZE, uio->uio_resid)) != 0) {
- uiomove(bpp->sc_cp = bpp->sc_inbuf->b_data, n, uio);
+ error = uiomove(bpp->sc_cp = bpp->sc_inbuf->b_data, n, uio);
+ if (error != 0)
+ return error;
bpp->sc_count = n;
error = bpppushbytes(bpp);
if (error) {
-/* $OpenBSD: lpt.c,v 1.6 2010/06/26 23:24:44 guenther Exp $ */
+/* $OpenBSD: lpt.c,v 1.7 2010/08/06 00:00:41 miod Exp $ */
/* $NetBSD: lpt.c,v 1.42 1996/10/21 22:41:14 thorpej Exp $ */
/*
int error = 0;
while ((n = min(LPT_BSIZE, uio->uio_resid)) != 0) {
- uiomove(sc->sc_cp = sc->sc_inbuf->b_data, n, uio);
+ error = uiomove(sc->sc_cp = sc->sc_inbuf->b_data, n, uio);
+ if (error != 0)
+ return error;
sc->sc_count = n;
error = lptpushbytes(sc);
if (error) {
-/* $OpenBSD: tty_pty.c,v 1.50 2010/07/26 01:56:27 guenther Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.51 2010/08/06 00:00:41 miod Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
if (pti->pt_send & TIOCPKT_IOCTL) {
cc = MIN(uio->uio_resid,
sizeof(tp->t_termios));
- uiomove(&tp->t_termios, cc, uio);
+ error = uiomove(&tp->t_termios, cc, uio);
+ if (error)
+ return (error);
}
pti->pt_send = 0;
return (0);
-/* $OpenBSD: ntfs_subr.c,v 1.18 2009/08/13 16:00:53 jasper Exp $ */
+/* $OpenBSD: ntfs_subr.c,v 1.19 2010/08/06 00:00:41 miod Exp $ */
/* $NetBSD: ntfs_subr.c,v 1.4 2003/04/10 21:37:32 jdolecek Exp $ */
/*-
return (error);
}
}
- if (uio)
- uiomove(bp->b_data + off, tocopy, uio);
- else
+ if (uio) {
+ error = uiomove(bp->b_data + off, tocopy, uio);
+ if (error != 0)
+ break;
+ } else
memcpy(bp->b_data + off, data, tocopy);
bawrite(bp);
data = data + tocopy;
}
}
- if (left) {
+ if (left && error == 0) {
printf("ntfs_writentvattr_plain: POSSIBLE RUN ERROR\n");
error = EINVAL;
}
return (error);
}
if (uio) {
- uiomove(bp->b_data + off,
+ error = uiomove(bp->b_data + off,
tocopy, uio);
+ if (error != 0)
+ break;
} else {
memcpy(data, bp->b_data + off,
tocopy);
off = 0;
if (uio) {
size_t remains = tocopy;
- for(; remains; remains--)
- uiomove("", 1, uio);
+ for(; remains; remains--) {
+ error = uiomove("", 1, uio);
+ if (error != 0)
+ break;
+ }
} else
bzero(data, tocopy);
data = data + tocopy;
}
cnt++;
+ if (error != 0)
+ break;
}
- if (left) {
+ if (left && error == 0) {
printf("ntfs_readntvattr_plain: POSSIBLE RUN ERROR\n");
error = E2BIG;
}
} else {
ddprintf(("ntfs_readnvattr_plain: data is in mft record\n"));
if (uio)
- uiomove(vap->va_datap + roff, rsize, uio);
+ error = uiomove(vap->va_datap + roff, rsize, uio);
else
memcpy(rdata, vap->va_datap + roff, rsize);
*initp += rsize;
if (init == ntfs_cntob(NTFS_COMPUNIT_CL)) {
if (uio)
- uiomove(cup + off, tocopy, uio);
+ error = uiomove(cup + off, tocopy, uio);
else
memcpy(data, cup + off, tocopy);
} else if (init == 0) {
if (uio) {
size_t remains = tocopy;
- for(; remains; remains--)
- uiomove("", 1, uio);
+ for(; remains; remains--) {
+ error = uiomove("", 1, uio);
+ if (error != 0)
+ break;
+ }
}
else
bzero(data, tocopy);
if (error)
break;
if (uio)
- uiomove(uup + off, tocopy, uio);
+ error = uiomove(uup + off, tocopy, uio);
else
memcpy(data, uup + off, tocopy);
}
+ if (error)
+ break;
left -= tocopy;
data = data + tocopy;