Skip to contentSkip to conversation

Array overrun in drivers/infiniband/core/cma.c

PATCH In review Eric Sesterhenn 2 participants 2 messages Jun 21, 2006 – Jun 26, 2006 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Array overrun in drivers/infiniband/core/cma.c

hi,

this was spotted by coverity #id 1300. Since
the array has only four elements, we should
just use those four.

Patch is against todays git tree.

drivers/infiniband/core/cma.c renamed from drivers/infiniband/core/cma.c.orig +1 -1
@@ -476,7 +476,7 @@ static inline int cma_zero_addr(struct s
 	else {
 		ip6 = &((struct sockaddr_in6 *) addr)->sin6_addr;
 		return (ip6->s6_addr32[0] | ip6->s6_addr32[1] |
-			ip6->s6_addr32[3] | ip6->s6_addr32[4]) == 0;
+			ip6->s6_addr32[2] | ip6->s6_addr32[3]) == 0;
 	}
 }
 
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Eric Sesterhenn

this was spotted by coverity #id 1300. Since
the array has only four elements, we should just use those four.

Patch is against todays git tree.

please apply Eric's patch below

Quoted 12 lines
drivers/infiniband/core/cma.c renamed from drivers/infiniband/core/cma.c.orig +1 -1
@@ -476,7 +476,7 @@ static inline int cma_zero_addr(struct s
 	else {
 		ip6 = &((struct sockaddr_in6 *) addr)->sin6_addr;
 		return (ip6->s6_addr32[0] | ip6->s6_addr32[1] |
-			ip6->s6_addr32[3] | ip6->s6_addr32[4]) == 0;
+			ip6->s6_addr32[2] | ip6->s6_addr32[3]) == 0;
 	}
 }