NetworkManager r3776 - trunk/src/dhcp-manager



Author: dcbw
Date: Thu Jun 26 19:23:29 2008
New Revision: 3776
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3776&view=rev

Log:
Use strtol not atoi (David Cantrell <dcantrell redhat com>) rh #447776

Modified:
   trunk/src/dhcp-manager/nm-dhcp-manager.c

Modified: trunk/src/dhcp-manager/nm-dhcp-manager.c
==============================================================================
--- trunk/src/dhcp-manager/nm-dhcp-manager.c	(original)
+++ trunk/src/dhcp-manager/nm-dhcp-manager.c	Thu Jun 26 19:23:29 2008
@@ -1015,7 +1015,12 @@
 
 	str = g_hash_table_lookup (device->options, "new_interface_mtu");
 	if (str) {
-		int int_mtu = atoi (str);
+		int int_mtu;
+
+		errno = 0;
+		int_mtu = strtol (str, NULL, 10);
+		if ((errno == EINVAL) || (errno == ERANGE))
+			goto error;
 
 		if (int_mtu)
 			nm_ip4_config_set_mtu (ip4_config, int_mtu);



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