mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-06 12:13:37 +08:00
Fix stats_display_memp() to avoid accessing NULLs
It's possible for pool pointers to be NULL. Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
committed by
Simon Goldschmidt
parent
13d7ac3363
commit
5d32779c1b
@@ -116,8 +116,12 @@ void
|
|||||||
stats_display_memp(struct stats_mem *mem, int idx)
|
stats_display_memp(struct stats_mem *mem, int idx)
|
||||||
{
|
{
|
||||||
if (idx < MEMP_MAX) {
|
if (idx < MEMP_MAX) {
|
||||||
|
if (mem == NULL) {
|
||||||
|
LWIP_PLATFORM_DIAG(("\nMEMP[%d]: NULL\n", idx));
|
||||||
|
} else {
|
||||||
stats_display_mem(mem, mem->name);
|
stats_display_mem(mem, mem->name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif /* MEMP_STATS */
|
#endif /* MEMP_STATS */
|
||||||
#endif /* MEM_STATS || MEMP_STATS */
|
#endif /* MEM_STATS || MEMP_STATS */
|
||||||
|
|||||||
Reference in New Issue
Block a user