Skip to content

Commit

Permalink
small cleanup in ax25_addr_parse()
Browse files Browse the repository at this point in the history
The comments were wrong here because "AX25_MAX_DIGIS" is 8 but the
comments say 6.  Also I've changed the "7" to "AX25_ADDR_LEN".

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Jul 9, 2012
1 parent e8efcec commit 5c9df5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/ax25/ax25_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ const unsigned char *ax25_addr_parse(const unsigned char *buf, int len,
digi->ndigi = 0;

while (!(buf[-1] & AX25_EBIT)) {
if (d >= AX25_MAX_DIGIS) return NULL; /* Max of 6 digis */
if (len < 7) return NULL; /* Short packet */
if (d >= AX25_MAX_DIGIS)
return NULL;
if (len < AX25_ADDR_LEN)
return NULL;

memcpy(&digi->calls[d], buf, AX25_ADDR_LEN);
digi->ndigi = d + 1;
Expand Down

0 comments on commit 5c9df5f

Please sign in to comment.