Re: [BUG] Smsbox crash with empty messages

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Wapme Systems AG
Message-ID <[email protected]>
Bruno David Rodrigues wrote:
> 
> I just love CVSWEB and checking-malloc;)
> 
> smsbox panics on smsbox line 1180 because of a empty text field (NULL):
> 
> http://www.kannel.3glab.org/cgi-bin/viewcvs.cgi/gateway/gw/smsbox.c?
> annotate=1.174#1180
> 
> In patch 1.164 at 2002/01/25:
>  udh == NULL ? ( text == NULL ? "" : octstr_get_cstr(text) ) : "<< UDH >>");
> 
>  udh == NULL ? ( text == NULL ? "" : octstr_get_cstr(text) ) :
>                 octstr_get_cstr(text));
> 
> Why ?!
> I'm reverting this line

octstr_get_cstr() requires an non-NULL octstr pointer. 

So if text == NULL then octstr_get_cstr() throws the assertion error
and panics the smsbox.

BTW, in the second statement you are not garanteeing that call to
octstr_get_cstr() does not have text == NULL, it's only handled in the
case udh == NULL.

Stipe

[email protected]
-------------------------------------------------------------------
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [email protected]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.