From da665985decffc0a5c7bed784f225d2972782bcd Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Fri, 27 Oct 2017 13:44:26 +0100 Subject: [PATCH] imaptest.c: Don't test possibly uninitialised local variable. get_imap_response() doesn't necessarily set the content of a non-NULL `char **status'. Do this before calling, and check if it's been set to non-NULL before using upon return. --- uip/imaptest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uip/imaptest.c b/uip/imaptest.c index 0e721ce2..8d3bccb7 100644 --- a/uip/imaptest.c +++ b/uip/imaptest.c @@ -597,6 +597,7 @@ imap_sasl_callback(enum sasl_message_type mtype, unsigned const char *indata, */ case NETSEC_SASL_FINISH: + line = NULL; if (get_imap_response(nsc, NULL, NULL, &line, 1, errstr) != OK) return NOTOK; /* @@ -604,7 +605,7 @@ imap_sasl_callback(enum sasl_message_type mtype, unsigned const char *indata, * parse it. */ - if (has_prefix(line, "OK [CAPABILITY ")) { + if (line && has_prefix(line, "OK [CAPABILITY ")) { char *p = line + 15, *q; q = strchr(p, ']'); -- 2.56.0