From 374107eb1e2ae576c10cdd538f45f18918df8c4b Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 17 Sep 2022 07:09:29 +0100 Subject: [PATCH] Unix static GSSAPI: fix an uninitialised structure field. When linking statically against Kerberos, the setup code in ssh_got_ssh_version() was trying to look up want_id==0 in the list of one GSSAPI library, but unfortunately, the id field of that record was not initialised at all, so if it happened to be nonzero nonsense, the loop wouldn't find a library at all and would fail an assertion. --- unix/gss.c | 1 + 1 file changed, 1 insertion(+) diff --git a/unix/gss.c b/unix/gss.c index cd9971c7..bd599fcc 100644 --- a/unix/gss.c +++ b/unix/gss.c @@ -140,6 +140,7 @@ struct ssh_gss_liblist *ssh_gss_setup(Conf *conf) list->libraries = snew(struct ssh_gss_library); list->nlibraries = 1; + list->libraries[0].id = 0; list->libraries[0].gsslogmsg = "Using statically linked GSSAPI"; #define BIND_GSS_FN(name) \