Fix bug with libzrtp zrtp_signaling_hash_set()

The function would silently not accept the imported zrtp-hash-value
with "buffer too small" in the debug output.

Modified-by: Travis Cross <tc@traviscross.com>
Signed-off-by: Travis Cross <tc@traviscross.com>
This commit is contained in:
Viktor Krykun
2012-06-21 11:36:33 +03:00
committed by Travis Cross
parent f311f81b8d
commit 7503d8aafa
4 changed files with 22 additions and 20 deletions

View File

@@ -113,7 +113,7 @@ const char* hex2str(const char* bin, int bin_size, char* buff, int buff_size)
if (NULL == buff) {
return "buffer is NULL";
}
if (buff_size < bin_size*2+1) {
if (buff_size < bin_size*2) {
return "buffer too small";
}
@@ -121,7 +121,8 @@ const char* hex2str(const char* bin, int bin_size, char* buff, int buff_size)
nptr = hex2char(nptr, *bin++);
}
*nptr = 0;
if (buff_size >= bin_size*2+1)
*nptr = 0;
return buff;
}