Skip to content

Commit 6ad3414

Browse files
tilmanschmidtdavem330
authored andcommitted
gigaset: correct range checking off by one error
Correct a potential array overrun due to an off by one error in the range check on the CAPI CONNECT_REQ CIPValue parameter. Found and reported by Dan Carpenter using smatch. Impact: bugfix Signed-off-by: Tilman Schmidt <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7f7708f commit 6ad3414

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/isdn/gigaset/capi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
13011301
}
13021302

13031303
/* check parameter: CIP Value */
1304-
if (cmsg->CIPValue > ARRAY_SIZE(cip2bchlc) ||
1304+
if (cmsg->CIPValue >= ARRAY_SIZE(cip2bchlc) ||
13051305
(cmsg->CIPValue > 0 && cip2bchlc[cmsg->CIPValue].bc == NULL)) {
13061306
dev_notice(cs->dev, "%s: unknown CIP value %d\n",
13071307
"CONNECT_REQ", cmsg->CIPValue);

0 commit comments

Comments
 (0)