diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-12-23 00:06:25 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-12-24 23:35:43 +0100 |
commit | 5fe164a258b2a8524de1bfa58e8faa082770bcdd (patch) | |
tree | 62d4dd203ab4107a7b02ecf0c9337737a84335fe /lib | |
parent | 57cad81091bb5b92a9e03b01b52f449e6c3a8cae (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.c | 4 |
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); |