X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/984c278593ba8b52cc30caf8d8dfaf184f3c5b4c..8374c3c:/uip/popsbr.c?ds=sidebyside diff --git a/uip/popsbr.c b/uip/popsbr.c index 9e394287..cf6b8042 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -347,6 +347,7 @@ pop_sasl_callback(enum sasl_message_type mtype, unsigned const char *indata, rc = netsec_printf(nsc, errstr, "AUTH %s %s\r\n", mech, b64data); free(b64data); + netsec_set_snoop_callback(nsc, NULL, NULL); if (rc != OK) return NOTOK; if (netsec_flush(nsc, errstr) != OK) @@ -382,7 +383,7 @@ pop_sasl_callback(enum sasl_message_type mtype, unsigned const char *indata, *outdata = NULL; *outdatalen = 0; } else { - rc = decodeBase64(line + 2, (const char **) outdata, &len, 0, NULL); + rc = decodeBase64(line + 2, outdata, &len, 0, NULL); *outdatalen = len; if (rc != OK) { netsec_err(errstr, "Unable to decode base64 response"); @@ -532,7 +533,7 @@ pop_retr (int msgno, int (*action)(char *)) static int traverse (int (*action)(char *), const char *fmt, ...) { - int result; + int result, snoopstate; va_list ap; char buffer[sizeof(response)]; @@ -544,13 +545,18 @@ traverse (int (*action)(char *), const char *fmt, ...) return NOTOK; strncpy (buffer, response, sizeof(buffer)); + if ((snoopstate = netsec_get_snoop(nsc))) + netsec_set_snoop(nsc, 0); + for (;;) switch (multiline ()) { case NOTOK: + netsec_set_snoop(nsc, snoopstate); return NOTOK; case DONE: strncpy (response, buffer, sizeof(response)); + netsec_set_snoop(nsc, snoopstate); return OK; case OK: @@ -720,7 +726,7 @@ pop_getline (char *s, int n, netsec_context *ns) * someday. */ - destlen = len < ((size_t) (n - 1)) ? len : n - 1; + destlen = len < ((size_t) (n - 1)) ? len : (size_t) (n - 1); memcpy(s, p, destlen); s[destlen] = '\0';