]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd: fix null pointer dereference in send_lsp()
authorAvneesh Sachdev <avneesh@opensourcerouting.org>
Sun, 6 May 2012 07:03:07 +0000 (00:03 -0700)
committerDavid Lamparter <equinox@opensourcerouting.org>
Thu, 25 Oct 2012 17:15:59 +0000 (10:15 -0700)
  * isisd/isis_pdu.c: (send_lsp) Handle case where there are no LSPs
    on the LSP transmission queue. This can happen if, for instance,
    the queue is cleared because of protocol events before the
    send_lsp thread gets a chance to run.

isisd/isis_pdu.c

index 7375a3ebf7dbc7b80c2a4f189c4d4184f318ae2b..ffc67178b4a04ac93cc6f6ceb7c419bc25142f77 100644 (file)
@@ -3033,7 +3033,19 @@ send_lsp (struct thread *thread)
     return retval;
   }
 
-  lsp = listgetdata ((node = listhead (circuit->lsp_queue)));
+  node = listhead (circuit->lsp_queue);
+
+  /*
+   * Handle case where there are no LSPs on the queue. This can
+   * happen, for instance, if an adjacency goes down before this
+   * thread gets a chance to run.
+   */
+  if (!node)
+    {
+      return retval;
+    }
+
+  lsp = listgetdata(node);
 
   /*
    * Do not send if levels do not match