[PATCH] faulty mime module

Paul Bagyenda <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi,

  There is a small but nasty bug in gwlib/mime.c which causes it to  
crash when parsing multi-part messages.  This is caused by free-ing  
an Octstr and then returning a pointer to the same (which then gets  
used)!

  The small diff attached fixes the problem.
mime.diff (application/octet-stream, 456 B)
Index: gwlib/mime.c
===================================================================
RCS file: /home/cvs/gateway/gwlib/mime.c,v
retrieving revision 1.16
diff -u -r1.16 mime.c
--- gwlib/mime.c	12 Oct 2006 23:54:46 -0000	1.16
+++ gwlib/mime.c	1 Nov 2006 06:08:34 -0000
@@ -204,6 +204,7 @@
     octstr_destroy(value);
     if (boundary_elem)
         *boundary_elem = boundary;
-    octstr_destroy(boundary);
+    else
+    	octstr_destroy(boundary);
 }
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.