summaryrefslogtreecommitdiff
path: root/isisd
diff options
context:
space:
mode:
authorAvneesh Sachdev <avneesh@opensourcerouting.org>2012-05-06 00:03:07 -0700
committerDavid Lamparter <equinox@opensourcerouting.org>2012-10-25 10:15:59 -0700
commit0fece074e8c9e282ae2cecf9a0a79dc6c930cfb1 (patch)
tree57807d45aaa0869b6b90291eedd30c084891274b /isisd
parenta22ab5a560c7a46f6ecc6feb874c0dbbde9699c6 (diff)
isisd: fix null pointer dereference in send_lsp()
* 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.
Diffstat (limited to 'isisd')
-rw-r--r--isisd/isis_pdu.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c
index 7375a3eb..ffc67178 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -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