summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-10-15 22:11:14 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2018-10-15 22:11:14 +0100
commit311126758e5335b19d5c6311ff63580e20f24b88 (patch)
tree0c067afddd2aac5c1b737b7b18fa32a3734cbc3f /plugin
parent1f8b0752adacca7a2f1800084ce45ec0a435f813 (diff)
downloadmariadb-git-311126758e5335b19d5c6311ff63580e20f24b88.tar.gz
MDEV-17462 Heap corruption with auth_gssapi on Windows.
use FreeContextAttributes() on individual members of SecPkgContext_NativeNames, not on the struct itself.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/auth_gssapi/sspi_server.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin/auth_gssapi/sspi_server.cc b/plugin/auth_gssapi/sspi_server.cc
index d2c2ae7e4b9..c3ec8161567 100644
--- a/plugin/auth_gssapi/sspi_server.cc
+++ b/plugin/auth_gssapi/sspi_server.cc
@@ -103,7 +103,12 @@ static int get_client_name_from_context(CtxtHandle *ctxt,
*p = 0;
}
strncpy(name, native_names.sClientName, name_len);
- FreeContextBuffer(&native_names);
+
+ if (native_names.sClientName)
+ FreeContextBuffer(native_names.sClientName);
+ if (native_names.sServerName)
+ FreeContextBuffer(native_names.sServerName);
+
return CR_OK;
}