<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    did the message was received via network from kamailio and attempted
    to be parsed or you gave it directly to the function for parsing? If
    the second case, then be sure the buffer is null-terminated.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 11/10/14 05:19, varun pratapsingh
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAMSCRP=VpRsA4spa3dQUys=rWRp01SKW15BOp+CKnFJGxOmRwQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">HI All,
        <div><br>
        </div>
        <div>According to Kamailio Devel Guide it is mentioned that
          pasrse_msg() fucntion returns 0 if it it parses the sip
          message finely and >0 if error occurs. </div>
        <div><br>
        </div>
        <div>I pass a anonymous packet to this function (packet which is
          not sip packet) then it should return >0 value but the
          function crashes. </div>
        <div><br>
        </div>
        <div>Here is gdb back trace:</div>
        <div><br>
        </div>
        <div>
          <div>#0  0x00000033d8c81261 in strnlen () from
            /lib64/libc.so.6</div>
          <div>#1  0x00000033d8c4526e in vfprintf () from
            /lib64/libc.so.6</div>
          <div>#2  0x00000033d8ce4dd0 in __vsyslog_chk () from
            /lib64/libc.so.6</div>
          <div>#3  0x00000033d8ce5000 in syslog () from /lib64/libc.so.6</div>
          <div>#4  0x0000000000624830 in parse_msg (</div>
          <div>    buf=0x7f93e0bd8d68
            "\373kÇ?V\020r\300m\221\217/\r\n\362\315\354\027\227k\366\200\251\252\367\036\336mã³¹\036\237\361\200\071\200Z\352\315\026\312\060\260`P\277\020\243ɬf;\273EV\"P\262",
            <incomplete sequence \366>, len=723,
            msg=0x7fff7af2c190) at parser/msg_parser.c:704</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Thanks and Regards</div>
        <div>Varun</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>