Double check if we have a packet before retransmitting it
authorMartin Willi <martin@revosec.ch>
Mon, 12 Dec 2011 14:43:12 +0000 (15:43 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:18 +0000 (17:31 +0100)
src/libcharon/sa/task_manager_v1.c

index b20a9ac..2af0ba2 100755 (executable)
@@ -871,12 +871,12 @@ METHOD(task_manager_t, process_message, status_t,
        else
        {
                hash = chunk_hash(msg->get_packet_data(msg));
-               if (hash == this->responding.hash)
+               if (hash == this->responding.hash && this->responding.packet)
                {
                        DBG1(DBG_IKE, "received retransmit of request with ID %d, "
                                 "retransmitting response", mid);
                        charon->sender->send(charon->sender,
-                                               this->responding.packet->clone(this->responding.packet));
+                                       this->responding.packet->clone(this->responding.packet));
                        return SUCCESS;
                }
                msg->set_request(msg, TRUE);