aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-12-23 00:06:25 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-12-24 23:35:43 +0100
commit5fe164a258b2a8524de1bfa58e8faa082770bcdd (patch)
tree62d4dd203ab4107a7b02ecf0c9337737a84335fe /lib
parent57cad81091bb5b92a9e03b01b52f449e6c3a8cae (diff)
ftp-gss: check for init before use
To avoid dereferencing a NULL pointer. Reported-by: Daniel Romero
Diffstat (limited to 'lib')
-rw-r--r--lib/security.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/security.c b/lib/security.c
index 4a8f44433..f4a876341 100644
--- a/lib/security.c
+++ b/lib/security.c
@@ -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);