Skip to content

Commit

Permalink
ax25: cleanup a range test
Browse files Browse the repository at this point in the history
The current test works fine in practice.  The "amount" variable is
actually used as a boolean so negative values or any non-zero values
count as "true".  However since we don't allow numbers greater than one,
let's not allow negative numbers either.

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Oct 18, 2013
1 parent 77dfca7 commit 7688775
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ax25/af_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
res = -EFAULT;
break;
}
if (amount > AX25_NOUID_BLOCK) {
if (amount < 0 || amount > AX25_NOUID_BLOCK) {
res = -EINVAL;
break;
}
Expand Down

0 comments on commit 7688775

Please sign in to comment.