diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index 4b1891d1be9d..dc3fbf2adf58 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -3749,6 +3749,9 @@ flashcard(struct ifnet *ifp, struct aironet_ioctl *l_ioctl) return ENOBUFS; break; case AIROFLSHGCHR: /* Get char from aux */ + if (l_ioctl->len > sizeof(sc->areq)) { + return -EINVAL; + } AN_UNLOCK(sc); status = copyin(l_ioctl->data, &sc->areq, l_ioctl->len); AN_LOCK(sc); @@ -3760,6 +3763,9 @@ flashcard(struct ifnet *ifp, struct aironet_ioctl *l_ioctl) else return -1; case AIROFLSHPCHR: /* Send char to card. */ + if (l_ioctl->len > sizeof(sc->areq)) { + return -EINVAL; + } AN_UNLOCK(sc); status = copyin(l_ioctl->data, &sc->areq, l_ioctl->len); AN_LOCK(sc);