DivestOS/Patches/LineageOS-14.1/android_system_netd/264481.patch

31 lines
1.1 KiB
Diff

From bea94d341f8c3da6611e959b4732accbb079cab1 Mon Sep 17 00:00:00 2001
From: Manoj Gupta <manojgupta@google.com>
Date: Tue, 22 Nov 2016 21:15:59 -0800
Subject: [PATCH] Fix clang static analyzer warnings.
system/netd/server/NetlinkHandler.cpp:218:12: warning: Dereference of
null pointer (loaded from variable 'gateway')
Test: Warning no longer appears
Change-Id: Idaa08940c990f7d572e855e77982ffd57a032dd4
---
server/NetlinkHandler.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/server/NetlinkHandler.cpp b/server/NetlinkHandler.cpp
index 19de240a..e9a11bab 100644
--- a/server/NetlinkHandler.cpp
+++ b/server/NetlinkHandler.cpp
@@ -215,9 +215,9 @@ void NetlinkHandler::notifyRouteChange(NetlinkEvent::Action action, const char *
"Route %s %s%s%s%s%s",
(action == NetlinkEvent::Action::kRouteUpdated) ? kUpdated : kRemoved,
route,
- *gateway ? " via " : "",
+ (gateway && *gateway) ? " via " : "",
gateway,
- *iface ? " dev " : "",
+ (iface && *iface) ? " dev " : "",
iface);
}