Module: kamailio
Branch: master
Commit: eaa4b177652259efda4e61aac9dd039ebde253c9
URL: 
https://github.com/kamailio/kamailio/commit/eaa4b177652259efda4e61aac9dd039ebde253c9

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2023-06-14T08:33:23+02:00

cdp: safety check on diameter msg processing

---

Modified: src/modules/cdp/peerstatemachine.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/eaa4b177652259efda4e61aac9dd039ebde253c9.diff
Patch: 
https://github.com/kamailio/kamailio/commit/eaa4b177652259efda4e61aac9dd039ebde253c9.patch

---

diff --git a/src/modules/cdp/peerstatemachine.c 
b/src/modules/cdp/peerstatemachine.c
index 2cdba653d56..24d5aed959e 100644
--- a/src/modules/cdp/peerstatemachine.c
+++ b/src/modules/cdp/peerstatemachine.c
@@ -1338,6 +1338,11 @@ void Rcv_Process(peer *p, AAAMessage *msg)
 {
        AAASession *session = 0;
        int nput = 0;
+
+       if(!msg) {
+               return;
+       }
+
        if(msg->sessionId)
                session = cdp_get_session(msg->sessionId->data);
 
@@ -1408,8 +1413,7 @@ void Rcv_Process(peer *p, AAAMessage *msg)
        }
        if(!nput && !put_task(p, msg)) {
                LM_ERR("Rcv_Process(): Queue refused task\n");
-               if(msg)
-                       AAAFreeMessage(&msg);
+               AAAFreeMessage(&msg);
        }
        //if (msg) LM_ERR("Rcv_Process(): task added to queue command %d, flags 
%#1x endtoend %u hopbyhop 
%u\n",msg->commandCode,msg->flags,msg->endtoendId,msg->hopbyhopId);
 

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to