Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | Upstream-Status: Pending |
| 2 | |
| 3 | Subject: ospf6d: check ospf6 before using it in ospf6_clean |
| 4 | |
| 5 | The ospf6 variable might be 'NULL' causing segment fault error. |
| 6 | Check it before referencing it. |
| 7 | |
| 8 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
| 9 | --- |
| 10 | ospf6d/ospf6d.c | 2 ++ |
| 11 | 1 file changed, 2 insertions(+) |
| 12 | |
| 13 | diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c |
| 14 | index 3cdd5c1..e3bf1af 100644 |
| 15 | --- a/ospf6d/ospf6d.c |
| 16 | +++ b/ospf6d/ospf6d.c |
| 17 | @@ -1892,6 +1892,8 @@ ospf6_init (void) |
| 18 | void |
| 19 | ospf6_clean (void) |
| 20 | { |
| 21 | + if (ospf6 == NULL) |
| 22 | + return; |
| 23 | if (ospf6->route_table) |
| 24 | ospf6_route_remove_all (ospf6->route_table); |
| 25 | if (ospf6->brouter_table) |
| 26 | -- |
| 27 | 1.9.1 |
| 28 | |