linux-cp: fix crash on processing dump of routes 17/39217/2
authorAlexander Chernavin <[email protected]>
Tue, 11 Jul 2023 11:10:48 +0000 (11:10 +0000)
committerMatthew Smith <[email protected]>
Wed, 12 Jul 2023 17:03:49 +0000 (17:03 +0000)
commitdf4d342d7618b959d9d2ac87aa70d47049b911bc
treeb51340ae5ae1c6eefd752806153789fe4a9da2f1
parentcf1880284c7dce21711442aa210c0d5971bb5289
linux-cp: fix crash on processing dump of routes

nl_route_add() recently started to use its optional argument to check
whether replace flag is set for the message. When notification messages
are processed, the argument is a pointer to the corresponding message
info. However, when dump replies are processed, the argument is a null
pointer. This leads to null pointer dereference and crash when dump of
routes is processed.

With this fix, check for replace flag only if message info was passed
to nl_route_add(). Otherwise, assume the flag is not set. Dump replies
do not have it set.

Type: fix
Change-Id: Icb04a1146e09cc965b623018c28f91b347be0eab
Signed-off-by: Alexander Chernavin <[email protected]>
src/plugins/linux-cp/lcp_nl.c