Skip to content

Commit

Permalink
Prevent buffer overflow in debug output.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfigus committed Feb 8, 2016
1 parent 68f8a88 commit 06542d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/math/datatypes.c
Expand Up @@ -117,7 +117,7 @@ char * srtp_octet_string_hex_string(const void *s, int length) {

/* truncate string if it would be too long */
if (length > MAX_PRINT_STRING_LEN)
length = MAX_PRINT_STRING_LEN-1;
length = MAX_PRINT_STRING_LEN-2;

for (i=0; i < length; i+=2) {
bit_string[i] = srtp_nibble_to_hex_char(*str >> 4);
Expand Down

0 comments on commit 06542d2

Please sign in to comment.