]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix undefined signed shift overflow
authorMichael McConville <mmcco@mykolab.com>
Tue, 2 Feb 2016 19:11:22 +0000 (14:11 -0500)
committerGert Doering <gert@greenie.muc.de>
Fri, 5 Feb 2016 07:29:23 +0000 (08:29 +0100)
Originally discussed here:

https://github.com/OpenVPN/openvpn/pull/42

Thanks for your time,
Michael

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20160202191122.GE1675@thinkpad.swarthmore.edu>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11050

Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/route.c

index 2012b5c0f5e2140febe3bc942d47d2568428505f..f4dee78d19a29c2b96ef768249443f839b8e9d91 100644 (file)
@@ -3128,7 +3128,8 @@ get_default_gateway (struct route_gateway_info *rgi)
   struct gc_arena gc = gc_new ();
   struct rtmsg m_rtmsg;
   int sockfd = -1;
-  int seq, l, pid, rtm_addrs, i;
+  int seq, l, pid, rtm_addrs;
+  unsigned int i;
   struct sockaddr so_dst, so_mask;
   char *cp = m_rtmsg.m_space; 
   struct sockaddr *gate = NULL, *ifp = NULL, *sa;
@@ -3330,7 +3331,8 @@ get_default_gateway_ipv6(struct route_ipv6_gateway_info *rgi6,
 
     struct rtmsg m_rtmsg;
     int sockfd = -1;
-    int seq, l, pid, rtm_addrs, i;
+    int seq, l, pid, rtm_addrs;
+    unsigned int i;
     struct sockaddr_in6 so_dst, so_mask;
     char *cp = m_rtmsg.m_space;
     struct sockaddr *gate = NULL, *ifp = NULL, *sa;