Re: Bug in gw/numhash.c

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Wapme Systems AG
Message-ID <[email protected]>
Paul Keogh wrote:
> 
> This module has a bug that causes a crash.
> 
> Replace
> 
>     if (octstr_str_compare(type, "text/plain") != 0) {
>         octstr_destroy(type);
>         octstr_destroy(reply_body);
>         error(0, "Strange content type <%s> for numhash, operatiomn fails",
>               octstr_get_cstr(type));
>         return NULL;
>     }
> 
> with
> 
>     if (octstr_str_compare(type, "text/plain") != 0) {
>         octstr_destroy(reply_body);
>         error(0, "Strange content type <%s> for numhash - expecting 'text/plain',
> operation fails",
>               octstr_get_cstr(type));
>         octstr_destroy(type);
>         return NULL;
>     }
> 
> as you can see, the Octstr *type is referenced after it is destroyed. Also,
> correct the spelling
> and indicate in the error text what MIME type is acceptable.

Fixed, thanks Paul.

Stipe

-- Hope to see you at my presentations:

   "Virtual Server solution for Linux using FreeVSD" 
   at O'Reilly Open Source Convention 2002,
   Sheraton San Diego Hotel and Marina, San Diego, CA. USA
   July 22-26, 2002 

[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.