X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/d6c3b7e970429b2d8325161a749fe06858d234bc..ab2c72d2f25e801aebf4cae0e0b8128b288ac5c5:/uip/imaptest.c diff --git a/uip/imaptest.c b/uip/imaptest.c index 66c033ce..2032e671 100644 --- a/uip/imaptest.c +++ b/uip/imaptest.c @@ -216,20 +216,20 @@ main (int argc, char **argv) if (initialtls || tls) { if (netsec_set_tls(nsc, 1, 0, &errstr) != OK) - adios(NULL, errstr); + adios(NULL, "%s", errstr); if (initialtls && netsec_negotiate_tls(nsc, &errstr) != OK) - adios(NULL, errstr); + adios(NULL, "%s", errstr); } if (sasl) { if (netsec_set_sasl_params(nsc, "imap", saslmech, imap_sasl_callback, nsc, &errstr) != OK) - adios(NULL, errstr); + adios(NULL, "%s", errstr); } if ((cp = netsec_readline(nsc, &len, &errstr)) == NULL) { - adios(NULL, errstr); + adios(NULL, "%s", errstr); } if (has_prefix(cp, "* BYE")) { @@ -295,7 +295,7 @@ main (int argc, char **argv) goto finish; } if (netsec_negotiate_tls(nsc, &errstr) != OK) { - adios(NULL, errstr); + adios(NULL, "%s", errstr); } } @@ -427,7 +427,6 @@ parse_capability(const char *cap, unsigned int len) } } - free(caplist); free(str); } @@ -598,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; /* @@ -605,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, ']');