ikev1: Properly initialize list of fragments in case fragment ID is 0
[strongswan.git] / src / libcharon / sa / ikev1 / task_manager_v1.c
index 6d4ef14..597416e 100644 (file)
@@ -1273,7 +1273,7 @@ static status_t handle_fragment(private_task_manager_t *this, message_t *msg)
                return FAILED;
        }
 
-       if (this->frag.id != payload->get_id(payload))
+       if (!this->frag.list || this->frag.id != payload->get_id(payload))
        {
                clear_fragments(this, payload->get_id(payload));
                this->frag.list = linked_list_create();