From 4d11cf6000e47624b53b21c108b18977cc9db0c2 Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Thu, 31 Dec 2015 01:59:35 +0000 Subject: 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 --- third_party/srtp/crypto/math/datatypes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'third_party/srtp/crypto') 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); -- cgit v1.2.3