sr: fix possible null-pointer dereference
[vpp.git] / src / vnet / srv6 / sr_localsid.c
index 79e4c2a..84306ad 100755 (executable)
@@ -743,7 +743,7 @@ end_srh_processing (vlib_node_runtime_t * node,
 {
   ip6_address_t *new_dst0;
 
-  if (PREDICT_TRUE (sr0->type == ROUTING_HEADER_TYPE_SR))
+  if (PREDICT_TRUE (sr0 && sr0->type == ROUTING_HEADER_TYPE_SR))
     {
       if (sr0->segments_left == 1 && psp)
        {