diff options
author | Liong Sauw Ming <ming@teluu.com> | 2015-12-31 01:59:35 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2015-12-31 01:59:35 +0000 |
commit | 4d11cf6000e47624b53b21c108b18977cc9db0c2 (patch) | |
tree | f9bcd202e6b46584da5e167a62a78f31f4ae6f37 /third_party | |
parent | 5e980e51786c939bf9208049a0e706ff6d5e67c3 (diff) |
Re #1882 (misc): re r5222, fixed string truncation length checking (the string is null terminated) in srtp.
Thanks to Dusan Klinec for the patch.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5225 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/srtp/crypto/math/datatypes.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/third_party/srtp/crypto/math/datatypes.c b/third_party/srtp/crypto/math/datatypes.c index 73451d71..c8f44a52 100644 --- a/third_party/srtp/crypto/math/datatypes.c +++ b/third_party/srtp/crypto/math/datatypes.c @@ -113,8 +113,8 @@ octet_string_hex_string(const void *s, int length) { length *= 2; /* truncate string if it would be too long */ - if (length >= MAX_PRINT_STRING_LEN) - length = MAX_PRINT_STRING_LEN-1; + if (length >= MAX_PRINT_STRING_LEN-1) + length = MAX_PRINT_STRING_LEN-2; for (i=0; i < length; i+=2) { bit_string[i] = nibble_to_hex_char(*str >> 4); |