From c9227cf6d24e0bafee3ada499dea183446aa35b1 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sun, 18 Jan 2015 01:34:16 +0300 Subject: [PATCH] Runtime check in linked list insert() --- libuavcan/include/uavcan/util/linked_list.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libuavcan/include/uavcan/util/linked_list.hpp b/libuavcan/include/uavcan/util/linked_list.hpp index 963cee9f02..d36e83b463 100644 --- a/libuavcan/include/uavcan/util/linked_list.hpp +++ b/libuavcan/include/uavcan/util/linked_list.hpp @@ -100,6 +100,10 @@ template void LinkedListRoot::insert(T* node) { UAVCAN_ASSERT(node); + if (node == NULL) + { + return; + } remove(node); // Making sure there will be no loops node->setNextListNode(root_); root_ = node;