diff options
author | Matt Caswell <matt@openssl.org> | 2015-08-04 13:03:20 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-08-04 13:06:58 +0100 |
commit | 44128847e8965ec64384ac48c65f5d28126b3666 (patch) | |
tree | 6b10b965d2bc113a2697818905ac12a283758a65 /ssl/packet_locl.h | |
parent | 8d11b7c7ee84ad0aa243476088285d15b22c5470 (diff) |
Fix a bug in the new PACKET implementation
Some of the PACKET functions were returning incorrect data. An unfortunate
choice of test data in the unit test was masking the failure.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'ssl/packet_locl.h')
-rw-r--r-- | ssl/packet_locl.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ssl/packet_locl.h b/ssl/packet_locl.h index 4aab5cb81a..80d0b93fd9 100644 --- a/ssl/packet_locl.h +++ b/ssl/packet_locl.h @@ -176,8 +176,8 @@ __owur static inline int PACKET_peek_net_3(PACKET *pkt, unsigned long *data) return 0; *data = ((unsigned long)(*pkt->curr)) << 16; - *data |= ((unsigned long)(*pkt->curr + 1)) << 8; - *data |= *pkt->curr + 2; + *data |= ((unsigned long)(*(pkt->curr + 1))) << 8; + *data |= *(pkt->curr + 2); return 1; } @@ -203,9 +203,9 @@ __owur static inline int PACKET_peek_net_4(PACKET *pkt, unsigned long *data) return 0; *data = ((unsigned long)(*pkt->curr)) << 24; - *data |= ((unsigned long)(*pkt->curr + 1)) << 16; - *data |= ((unsigned long)(*pkt->curr + 2)) << 8; - *data |= *pkt->curr+3; + *data |= ((unsigned long)(*(pkt->curr + 1))) << 16; + *data |= ((unsigned long)(*(pkt->curr + 2))) << 8; + *data |= *(pkt->curr+3); return 1; } @@ -254,9 +254,9 @@ __owur static inline int PACKET_peek_4(PACKET *pkt, unsigned long *data) return 0; *data = *pkt->curr; - *data |= ((unsigned long)(*pkt->curr + 1)) << 8; - *data |= ((unsigned long)(*pkt->curr + 2)) << 16; - *data |= ((unsigned long)(*pkt->curr + 3)) << 24; + *data |= ((unsigned long)(*(pkt->curr + 1))) << 8; + *data |= ((unsigned long)(*(pkt->curr + 2))) << 16; + *data |= ((unsigned long)(*(pkt->curr + 3))) << 24; return 1; } |