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 authored and Travis Cross committed 2013-02-11 16:42:01 +00:00
1 parent f311f81b8d
commit 7503d8aafa
4 files changed
+22 -20

No files matched your search

+3 -2
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;
}