net: use strnstr() for lwip_strnstr()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 3 Feb 2025 09:12:02 +0000 (10:12 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 12 Feb 2025 18:37:19 +0000 (12:37 -0600)
Using strstr() instead of strnstr() creates a security concern.

Fixes: 1c41a7afaa15 ("net: lwip: build lwIP")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
lib/lwip/u-boot/arch/cc.h

index de13884..6104c29 100644 (file)
@@ -34,7 +34,7 @@
               x, __LINE__, __FILE__); } while (0)
 
 #define atoi(str) (int)dectoul(str, NULL)
-#define lwip_strnstr(a, b, c)  strstr(a, b)
+#define lwip_strnstr(a, b, c)  strnstr(a, b, c)
 
 #define LWIP_ERR_T int
 #define LWIP_CONST_CAST(target_type, val) ((target_type)((uintptr_t)val))