1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

ftp-gss: check for init before use

To avoid dereferencing a NULL pointer.

Reported-by: Daniel Romero
This commit is contained in:
Daniel Stenberg 2016-12-23 00:06:25 +01:00
parent 57cad81091
commit 5fe164a258

View File

@ -367,6 +367,10 @@ int Curl_sec_read_msg(struct connectdata *conn, char *buffer,
size_t decoded_sz = 0;
CURLcode error;
if(!conn->mech)
/* not inititalized, return error */
return -1;
DEBUGASSERT(level > PROT_NONE && level < PROT_LAST);
error = Curl_base64_decode(buffer + 4, (unsigned char **)&buf, &decoded_sz);