diff --git a/[refs] b/[refs] index e0454393c3fb..f5d614e7efa8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5ac5bd8754b3dabcf4aea7b5f4a28a1d8494a1b0 +refs/heads/master: e228b7426e65df0f2e93c783c2c89baabe318b9b diff --git a/trunk/drivers/staging/bcm/Bcmchar.c b/trunk/drivers/staging/bcm/Bcmchar.c index 1905a83b3385..4c4335383977 100644 --- a/trunk/drivers/staging/bcm/Bcmchar.c +++ b/trunk/drivers/staging/bcm/Bcmchar.c @@ -690,6 +690,9 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) if (IoBuffer.InputLength < sizeof(struct link_request)) return -EINVAL; + if (IoBuffer.InputLength > MAX_CNTL_PKT_SIZE) + return -EINVAL; + pvBuffer = kmalloc(IoBuffer.InputLength, GFP_KERNEL); if (!pvBuffer) return -ENOMEM; diff --git a/trunk/drivers/staging/bcm/Misc.c b/trunk/drivers/staging/bcm/Misc.c index c5b3a3666bc7..9da94086987f 100644 --- a/trunk/drivers/staging/bcm/Misc.c +++ b/trunk/drivers/staging/bcm/Misc.c @@ -421,6 +421,10 @@ INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter,/**PLength = pktlen; } } + + if (pktlen + LEADER_SIZE > MAX_CNTL_PKT_SIZE) + return -EINVAL; + memset(ctrl_buff, 0, pktlen+LEADER_SIZE); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Copying the Control Packet Buffer with length=%d\n", pLeader->PLength); *(PLEADER)ctrl_buff=*pLeader;