From 801beb4b4d5204a9930d3ff04d9b035bf9949bd0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 5 Apr 2011 09:58:49 -0500 Subject: [PATCH] ip6: prevent overflows in RDNSS and DNSSL timeout calculations (rh #689291) --- src/ip6-manager/nm-ip6-manager.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index df520388e9..ac4d5fc9c9 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -308,9 +308,9 @@ set_rdnss_timeout (NMIP6Device *device) } if (expires) { - device->rdnss_timeout_id = g_timeout_add_seconds (expires - now, - rdnss_expired, - device); + device->rdnss_timeout_id = g_timeout_add_seconds (MIN (expires - now, G_MAXUINT32 - 1), + rdnss_expired, + device); } } @@ -363,7 +363,7 @@ set_dnssl_timeout (NMIP6Device *device) } if (expires) { - device->dnssl_timeout_id = g_timeout_add_seconds (expires - now, + device->dnssl_timeout_id = g_timeout_add_seconds (MIN (expires - now, G_MAXUINT32 - 1), dnssl_expired, device); }