diff options
Diffstat (limited to 'net/wireless/wext-core.c')
-rw-r--r-- | net/wireless/wext-core.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c index 76a80a416..a57f54bc0 100644 --- a/net/wireless/wext-core.c +++ b/net/wireless/wext-core.c @@ -796,6 +796,12 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd, } } + /* Sanity-check to ensure we never end up _allocating_ zero + * bytes of data for extra. + */ + if (extra_size <= 0) + return -EFAULT; + /* kzalloc() ensures NULL-termination for essid_compat. */ extra = kzalloc(extra_size, GFP_KERNEL); if (!extra) |