summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2005-01-07 20:19:03 +0000
committerSimon Josefsson <simon@josefsson.org>2005-01-07 20:19:03 +0000
commit124d9a912dd6f6a92142cd0d24c68581e41f744b (patch)
tree5de070bee852ac181cd7861bf55a5c8d2d8fcce4
parentf0dc267c4813d076bfdee3ae7da941a09ecf316a (diff)
downloadgnutls-124d9a912dd6f6a92142cd0d24c68581e41f744b.tar.gz
(_gnutls_x509_data2hex): Make sure bin2hex will convert entire string
first, because bin2hex will not return NULL any longer.
-rw-r--r--lib/x509/common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/x509/common.c b/lib/x509/common.c
index 7e96be01d3..74b3b4beb3 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -287,6 +287,12 @@ int _gnutls_x509_data2hex(const opaque * data, size_t data_size,
char *res;
char escaped[MAX_STRING_LEN];
+ if (2 * data_size + 1 > MAX_STRING_LEN)
+ {
+ gnutls_assert();
+ return GNUTLS_E_INTERNAL_ERROR;
+ }
+
res = _gnutls_bin2hex(data, data_size, escaped, sizeof(escaped));
if (res) {