Skip to content

Commit

Permalink
Allow zero payload packets to pass bounds check.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfigus committed Nov 20, 2015
1 parent cdc69f2 commit be06686
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions srtp/srtp.c
Expand Up @@ -950,7 +950,7 @@ srtp_protect_aead (srtp_ctx_t *ctx, srtp_stream_ctx_t *stream,
srtp_hdr_xtnd_t *xtn_hdr = (srtp_hdr_xtnd_t*)enc_start;
enc_start += (ntohs(xtn_hdr->length) + 1);
}
if (!((uint8_t*)enc_start < (uint8_t*)hdr + *pkt_octet_len))
if (!((uint8_t*)enc_start <= (uint8_t*)hdr + *pkt_octet_len))
return err_status_parse_err;
enc_octet_len = (int)(*pkt_octet_len -
((uint8_t*)enc_start - (uint8_t*)hdr));
Expand Down Expand Up @@ -1308,7 +1308,7 @@ srtp_unprotect_aead (srtp_ctx_t *ctx, srtp_stream_ctx_t *stream, int delta,
srtp_hdr_xtnd_t *xtn_hdr = (srtp_hdr_xtnd_t *)enc_start;
enc_start += (ntohs(xtn_hdr->length) + 1);
}
if (!((uint8_t*)enc_start < (uint8_t*)hdr + *pkt_octet_len))
if (!((uint8_t*)enc_start <= (uint8_t*)hdr + *pkt_octet_len))
return err_status_parse_err;
enc_octet_len = (int)(*pkt_octet_len -
((uint8_t*)enc_start - (uint8_t*)hdr));
Expand Down

0 comments on commit be06686

Please sign in to comment.