im.pidgin.pidgin: a4c4bba4aa71dc352be290b5e3a2ec143cdcc5c4

khc at pidgin.im khc at pidgin.im
Thu Feb 28 03:53:09 EST 2008


-----------------------------------------------------------------
Revision: a4c4bba4aa71dc352be290b5e3a2ec143cdcc5c4
Ancestor: b172eef76780c71c49e3d4afc89bf3a043f692a8
Author: khc at pidgin.im
Date: 2008-02-28T08:41:23
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a4c4bba4aa71dc352be290b5e3a2ec143cdcc5c4

Modified files:
        libpurple/util.c

ChangeLog: 

Fixes an error detected by valgrind:
==10815== Conditional jump or move depends on uninitialised value(s)
==10815==    at 0x45E89A8: purple_ip_address_is_valid (util.c:4138)
==10815==    by 0x540A1C0: jabber_login_connect (jabber.c:573)
==10815==    by 0x540A2BC: srv_resolved_cb (jabber.c:593)

Credit goes to Andrew Gaul for discovering this and coming up with the fix,
and sadrul for triple checking.


-------------- next part --------------
============================================================
--- libpurple/util.c	d13cc8319912ac1e9a79b8026579c2a8112cde0e
+++ libpurple/util.c	510a6d621b69ed995a69c3cedc74560ced04fb21
@@ -4135,7 +4135,7 @@ purple_ip_address_is_valid(const char *i
 	int c, o1, o2, o3, o4;
 	char end;
 	c = sscanf(ip, "%d.%d.%d.%d%c", &o1, &o2, &o3, &o4, &end);
-	if (c > 4 || o1 < 0 || o1 > 255 || o2 < 0 || o2 > 255 || o3 < 0 || o3 > 255 || o4 < 0 || o4 > 255)
+	if (c != 4 || o1 < 0 || o1 > 255 || o2 < 0 || o2 > 255 || o3 < 0 || o3 > 255 || o4 < 0 || o4 > 255)
 		return FALSE;
 	return TRUE;
 }


More information about the Commits mailing list