debugger: fix orig offset computation inside w_dbg_sip_msg()
authorDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 21 Jul 2017 06:53:53 +0000 (08:53 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 21 Jul 2017 06:53:53 +0000 (08:53 +0200)
src/modules/debugger/debugger_mod.c

index 97dee43..5c973c5 100644 (file)
@@ -547,9 +547,11 @@ static int w_dbg_sip_msg(struct sip_msg* msg, char *level, char *facility)
        }
 
        /* skip original uri */
-       if (msg->new_uri.s){
-               orig_offs=msg->first_line.u.request.uri.s - msg->buf;
-               orig_offs=msg->first_line.u.request.uri.len;
+       if(msg->first_line.type == SIP_REQUEST) {
+               if(msg->new_uri.s) {
+                       orig_offs = msg->first_line.u.request.uri.s - msg->buf;
+                       orig_offs += msg->first_line.u.request.uri.len;
+               }
        }
 
        /* alloc private mem and copy lumps */