diff options
author | Martin Storsjo <martin@martin.st> | 2012-10-31 15:44:35 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-10-31 18:35:44 +0100 |
commit | d4b6bd3f3e61ff8af04f4d088718a8873512ca01 (patch) | |
tree | c8a4916e890ead4189b1395b4e39a651b3d6514a /lib/ext | |
parent | acca614b0f77ec74d403c1de67d69befa4242b5b (diff) | |
download | gnutls-d4b6bd3f3e61ff8af04f4d088718a8873512ca01.tar.gz |
server_name: Return the actual required buffer size if the buffer is too small
Since we require space for the null termination, include this in
the info returned if the caller provided a too small buffer.
Otherwise, if the caller allocated a buffer of exactly the suggested
size, it would still be too small.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'lib/ext')
-rw-r--r-- | lib/ext/server_name.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ext/server_name.c b/lib/ext/server_name.c index 005d80b948..520b69f520 100644 --- a/lib/ext/server_name.c +++ b/lib/ext/server_name.c @@ -322,7 +322,7 @@ gnutls_server_name_get (gnutls_session_t session, void *data, } else { - *data_length = priv->server_names[indx].name_length; + *data_length = priv->server_names[indx].name_length + 1; return GNUTLS_E_SHORT_MEMORY_BUFFER; } |