diff options
Diffstat (limited to 'lib/ext_srp.c')
-rw-r--r-- | lib/ext_srp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ext_srp.c b/lib/ext_srp.c index eb373415f1..8fe9d6e771 100644 --- a/lib/ext_srp.c +++ b/lib/ext_srp.c @@ -74,6 +74,8 @@ int _gnutls_srp_send_params( GNUTLS_STATE state, opaque** data) { if (cred->username!=NULL) { /* send username */ len = strlen(cred->username); (*data) = gnutls_malloc(len+1); /* hold the size also */ + if (*data==NULL) return GNUTLS_E_MEMORY_ERROR; + (*data)[0] = len; memcpy( &(*data)[1], cred->username, len); return len + 1; |