hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/net/wireless/wext-core.c
....@@ -796,6 +796,12 @@
796796 }
797797 }
798798
799
+ /* Sanity-check to ensure we never end up _allocating_ zero
800
+ * bytes of data for extra.
801
+ */
802
+ if (extra_size <= 0)
803
+ return -EFAULT;
804
+
799805 /* kzalloc() ensures NULL-termination for essid_compat. */
800806 extra = kzalloc(extra_size, GFP_KERNEL);
801807 if (!extra)