diff options
author | Michael Chapman <mike@very.puzzling.org> | 2016-08-16 19:07:42 +1000 |
---|---|---|
committer | Michael Chapman <mike@very.puzzling.org> | 2016-08-16 19:07:42 +1000 |
commit | 856e309d7b18cabe18c845bdf57e92958343a9ec (patch) | |
tree | 27264904693ca22921b18e54b5ddce261030b3a1 | |
parent | 5f9a610ad2b3200a31bbd9181c810726eeb30385 (diff) |
networkd: avoid NULL pointer dereference in route_add
If no result parameter is provided, do not attempt to write the
found/newly-created route to it. This is presently not an issue as all
callers currently provide a non-NULL result parameter, however we should
do this for symmetry with address_add and future code robustness.
-rw-r--r-- | src/network/networkd-route.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index cedaf47cf8..82f9047ff6 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -322,7 +322,8 @@ int route_add( } else return r; - *ret = route; + if (ret) + *ret = route; return 0; } |