Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Security Level: public
    • Labels:
      None
    • CPU Architecture:
      x86-64
    • Kernel:
      Linux
    • Userland:
      GNU/Linux
    • Distribution:
      Debian
    • Distribution Version:
      Debian 8 jessie
    • Compiler:
      gcc
    • FreeSWITCH GIT Revision:
      FreeSWITCH Version 1.9.0+git~20170103T000654Z~848730a320~64bit (git 848730a 2017-01-03 00:06:54Z 64bit)
    • GIT Master Revision hash::
      FreeSWITCH Version 1.9.0+git~20170103T000654Z~848730a320~64bit (git 848730a 2017-01-03 00:06:54Z 64bit)

      Description

      when receive MESSAGE with tcp follows by another ACK, fs send wrong MESSAGE packet out.

      1. extra-message.txt
        3 kB
        Seven Du
      2. message.log
        7 kB
        Seven Du
      3. messagewithack.pcap
        1.0 kB
        Seven Du
      4. mod_sms.txt
        12 kB
        Seven Du
      5. test.sip.fslog.txt
        6 kB
        Seven Du
      6. test.sip.txt
        0.8 kB
        Seven Du

        Activity

        Hide
        seven Seven Du added a comment -
        attach message.log which is not fail in libsofia but FS send it wrong. message.log
        Show
        seven Seven Du added a comment - attach message.log which is not fail in libsofia but FS send it wrong. message.log
        Hide
        mikej Mike Jerris added a comment -
        I'm guessing when we get the MESSAGE, the body is not NULL terminated?
        Show
        mikej Mike Jerris added a comment - I'm guessing when we get the MESSAGE, the body is not NULL terminated?
        Hide
        seven Seven Du added a comment -
        added log around sofia_presence.c:4854

        if (payload) {
        msg = payload->pl_data;
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "message [%s]\n", msg);
        }

        add test with the attached txt

        nc 192.168.3.119 5060 < test.sip.txt


        2017-01-05 14:26:27.004132 [WARNING] sofia_presence.c:4856 message [PEER_INFO_MSG@{"PeerID":"1009,"PeerIP":"10.1.39.63"}ACK sip:1011@10.1.39.122:8880;transport=tcp SIP/2.0
        Via: SIP/2.0/TCP 10.1.39.63:36251;rport;branch=z9hG4bKPj639b528f70404c82b92e6a8083c9e212;alias
        Max-Forwards: 70
        From: "1009_2016-12-09" <sip:1009@10.1.39.122>;tag=fc71ae93e07147ee9ca1b4a1b8f91224
        To: sip:1011@10.1.39.122;tag=c8Q9gQemyN3XK
        Call-ID: 8d52bcc8f7014d68953dcce965248a23
        CSeq: 15908 ACK
        Content-Length: 0


        ]

        so it's pl_data not NULL terminated.
        Show
        seven Seven Du added a comment - added log around sofia_presence.c:4854 if (payload) { msg = payload->pl_data; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "message [%s]\n", msg); } add test with the attached txt nc 192.168.3.119 5060 < test.sip.txt 2017-01-05 14:26:27.004132 [WARNING] sofia_presence.c:4856 message [PEER_INFO_MSG@{"PeerID":"1009,"PeerIP":"10.1.39.63"}ACK sip: 1011@10.1.39.122 :8880;transport=tcp SIP/2.0 Via: SIP/2.0/TCP 10.1.39.63:36251;rport;branch=z9hG4bKPj639b528f70404c82b92e6a8083c9e212;alias Max-Forwards: 70 From: "1009_2016-12-09" <sip: 1009@10.1.39.122 >;tag=fc71ae93e07147ee9ca1b4a1b8f91224 To: sip: 1011@10.1.39.122 ;tag=c8Q9gQemyN3XK Call-ID: 8d52bcc8f7014d68953dcce965248a23 CSeq: 15908 ACK Content-Length: 0 ] so it's pl_data not NULL terminated.
        Hide
        seven Seven Du added a comment -
        I also added pl_len and it looks right

        2017-01-05 14:31:57.794099 [WARNING] sofia_presence.c:4856 message len=52

        So, the parser is fine. we just find a way to add a NULL at the end, or we just copy up to len
        Show
        seven Seven Du added a comment - I also added pl_len and it looks right 2017-01-05 14:31:57.794099 [WARNING] sofia_presence.c:4856 message len=52 So, the parser is fine. we just find a way to add a NULL at the end, or we just copy up to len
        Hide
        mikej Mike Jerris added a comment -
        pushed a patch to master that fixes the test case (and other related cases where message payload isn't properly null terminated)
        Show
        mikej Mike Jerris added a comment - pushed a patch to master that fixes the test case (and other related cases where message payload isn't properly null terminated)

          People

          • Assignee:
            mikej Mike Jerris
            Reporter:
            seven Seven Du
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development