aboutsummaryrefslogtreecommitdiffstats
path: root/net/ax25
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-07-04 18:27:18 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-09 03:16:16 -0400
commit5c9df5fed198ad8b967f33a1e11862f2a1d08bf7 (patch)
tree1b84152d244d5319c5c0594c429236f7ca1b9e44 /net/ax25
parente8efcec5394cbf7ae67ccb137cb1a45ae3e6f6c8 (diff)
small cleanup in ax25_addr_parse()
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 <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ax25')
-rw-r--r--net/ax25/ax25_addr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c
index 9162409559cf..e7c9b0ea17a1 100644
--- a/net/ax25/ax25_addr.c
+++ b/net/ax25/ax25_addr.c
@@ -189,8 +189,10 @@ const unsigned char *ax25_addr_parse(const unsigned char *buf, int len,
189 digi->ndigi = 0; 189 digi->ndigi = 0;
190 190
191 while (!(buf[-1] & AX25_EBIT)) { 191 while (!(buf[-1] & AX25_EBIT)) {
192 if (d >= AX25_MAX_DIGIS) return NULL; /* Max of 6 digis */ 192 if (d >= AX25_MAX_DIGIS)
193 if (len < 7) return NULL; /* Short packet */ 193 return NULL;
194 if (len < AX25_ADDR_LEN)
195 return NULL;
194 196
195 memcpy(&digi->calls[d], buf, AX25_ADDR_LEN); 197 memcpy(&digi->calls[d], buf, AX25_ADDR_LEN);
196 digi->ndigi = d + 1; 198 digi->ndigi = d + 1;