Bug in gw/numhash.c

"Paul Keogh" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
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.

Paul Keogh
ANAM Wireless Internet Solutions
http://www.anam.com
+353 1 284 7555 (wired)               +353 86 234 6047 (wireless)
Castle Yard, Saint Patrick's Road, Dalkey, County Dublin, Ireland
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.