Here is a small patch that fixes a segfault
ms is not checked against null,
so octstr_write_to_socket() will fail, resulting in a segfault

traceback:
----------

Core was generated by `/usr/local/bin/mmsbox-1.4.1_x86_64 /etc/mbuni.conf'.
Program terminated with signal 11, Segmentation fault.

#0  0x000000000045cecd in octstr_write_data (ostr=0x0, fd=55, 
from=140463080621520) at gwlib/octstr.c:1210
1210        ret = write(fd, ostr->data + from, ostr->len - from);
(gdb)
(gdb) bt full
#0  0x000000000045cecd in octstr_write_data (ostr=0x0, fd=55, 
from=140463080621520) at gwlib/octstr.c:1210
        ret = <value optimized out>
#1  0x0000000000000037 in ?? ()
No symbol table info available.
#2  0x00007fc01c068450 in ?? ()
No symbol table info available.
#3 0x0000000000425dd4 in writemmsdata (ms=<value optimized out>, df=<value optimized out>, subdir=<value optimized out>, mms_queuedir=<value optimized out>) at mms_queue.c:677
        dfname = 0x1
        fd = 0
        n = 55
        res = 0
        __FUNCTION__ = "writemmsdata"
        __func__ = "writemmsdata"
#4 0x0000000000427e97 in mms_queue_add (from=0x7fc01c068dc0, to=0x7fc01c0637c0, subject=0x0, fromproxy=0x1fcb100, viaproxy=0x0, senddate=0, expirydate=1289757965, m=0x0,
    token=0x0, vaspid=0x0, vasid=0x0, url1=0x7fc01c06a370, url2=0x0, hdrs=0x7fc01c000910, 
dlr=0, directory=0x1fc9440 "/xms-gw/mms/mmsbox_incoming",
    src_interface=0x46f625 "issing 'from' argument", mmscname=0x0) at 
mms_queue.c:769
        qf = "df7965.4901.x677.24", '\000' <repeats 108 times>
subdir = "e/\000\001\000\000\000\000cÂa\000\000\000\000\000\060Ü_kÀ\177\000\000n\000`ÿÿÿÿÿÐÆ\006\034À\177\000\...@Ü_kÀ\177\000\000\000\000\000\000\000\000\000\000@\224ü\001\000\000\000"
        fd = 52
        e = 0x7fc01c068450
        ms = 0x0
        res = <value optimized out>
        qfs = 0x7fc01c068600
        __FUNCTION__ = "mms_queue_add"
        __func__ = "mms_queue_add"
#5  0x000000000041edd4 in mm7soap_receive (rl=0x7fc0400008c0) at bearerbox.c:323
        value = 0x7fc01c069620
        value2 = 0x7fc01c06a370
        mresp = 0x0
        expiryt = -1
        uaprof_tstamp = -1
        qf = 0x0
        qhdr = 0x7fc01c000910
        vasid = 0x0
        delivert = -1
        status = 1000
        uaprof = 0x0
        m = 0x0
        mmc_id = 0x0
        rh = 0x0
        mreq = 0x7fc01c0637a0
        hstatus = 200
        reply_body = 0x0
        to = 0x7fc01c0637c0
        from = 0x7fc01c068dc0
        subject = 0x0
        msgid = 0x7fc01c06c6a0
        msgtype = <value optimized out>
        qdir = <value optimized out>


--
Telemaque - 06560 SOPHIA-ANTIPOLIS - (FR)
Service Technique/Reseau - NOC
Direction du Developpement Mobile
http://www.telemaque.fr/
v.chava...@telemaque.fr
Tel : +33 4 92 90 99 84 (fax 9142)
--- /mbuni-cvs/mmlib/mms_queue.c        2010-11-09 15:07:01.849248930 +0100
+++ /mbuni/mmlib/mms_queue.c    2010-11-15 15:18:10.981466904 +0100
@@ -656,6 +656,8 @@
      Octstr *dfname;
      int fd, n, res = 0;
 
+     if (ms == NULL)
+         return 0;
      
      dfname = octstr_format("%s/%s%s", mms_queuedir, subdir, df);
_______________________________________________
Devel mailing list
Devel@mbuni.org
http://lists.mbuni.org/mailman/listinfo/devel

Reply via email to