mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
lib: fix a Null Pointer Dereference bug in vrf.c
Function vrf_get can return a NULL value. if (vrf && vrf_id != VRF_UNKNOWN && vrf->vrf_id != VRF_UNKNOWN && vrf->vrf_id != vrf_id) { zlog_debug("VRF_GET: avoid %s creation(%u), same name exists (%u)", name, vrf_id, vrf->vrf_id); return NULL; } In function lib_vrf_create, the return value from vrf_get is dereferenced without any null value check, causing a null pointer dereference bug. Fix: We noticed that other caller functions both check the return value of function vrf_get, thus similarly, we check the return value and return NB_ERR if null. Signed-off-by: mugitya03 <mugitya233@outlook.com>
This commit is contained in:
parent
1e2a438764
commit
99d59d171a
Loading…
Reference in a new issue