diff libgaim/network.c @ 15054:f58283ce58ea

[gaim-migrate @ 17838] Validate the IP address entered by the user in prefs before trying to use it. This should fix a few crashes. I feel like we could get rid of gaim_network_ip_atoi() and just use inet_aton() committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 28 Nov 2006 09:05:34 +0000
parents e429c4ebbae5
children ae58cf5a441f
line wrap: on
line diff
--- a/libgaim/network.c	Tue Nov 28 08:44:12 2006 +0000
+++ b/libgaim/network.c	Tue Nov 28 09:05:34 2006 +0000
@@ -166,7 +166,8 @@
 	/* Check if the user specified an IP manually */
 	if (!gaim_prefs_get_bool("/core/network/auto_ip")) {
 		ip = gaim_network_get_public_ip();
-		if ((ip != NULL) && (*ip != '\0'))
+		/* Make sure the IP address entered by the user is valid */
+		if ((ip != NULL) && (gaim_network_ip_atoi(ip) != NULL))
 			return ip;
 	}