diff --git a/src/sys/pioctl_nt.c b/src/sys/pioctl_nt.c index 7dc238d511..3a3f83ea40 100644 --- a/src/sys/pioctl_nt.c +++ b/src/sys/pioctl_nt.c @@ -844,6 +844,10 @@ pioctl(char *pathp, long opcode, struct ViceIoctl *blobp, int follow) MarshallString(&preq, fullPath); if (blobp->in_size) { + if (blobp->in_size > sizeof(preq.data) - (preq.mp - preq.data)*sizeof(char)) { + errno = E2BIG; + return -1; + } memcpy(preq.mp, blobp->in, blobp->in_size); preq.mp += blobp->in_size; }