[gmime-devel] Segfault when parsing invalid address list (spaces in addresses)



The current gmime version (from git) will crash if there is an invalid
white character in an address like this one:

To: sdfsdf wp pl,s sdfsaf wp pl,t sfsdfec op pl

It will read past the buffer. I've attached a simple patch to fix this
bug.
Poprawka segfault przy parsowaniu listy adresow, ktora ma biale znaki w adresie np.

To: sdfasf wp pl,c tert wp pl,sffdg rtre op pl
Index: gmime/internet-address.c
===================================================================
--- gmime/internet-address.c	(revision 6747)
+++ gmime/internet-address.c	(working copy)
@@ -1542,6 +1542,10 @@
 		 *             /  "," / ";" / ":" / "\" / <">  ;  string, to use
 		 *             /  "." / "[" / "]"              ;  within a word.
 		 **/
+		if (!*inptr) {
+			w(g_warning ("Invalid addr spec (truncated)."));
+			break;
+		}
 		if (*inptr == ':') {
 			/* group */
 			inptr++;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]