X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/af2971700a5d9fbc9f68c4afca5ba6567e800260..f345b9b480296b4b6a8469d6221752893c5d1420:/uip/popsbr.c diff --git a/uip/popsbr.c b/uip/popsbr.c index 479fdb1f..ccc76c7c 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -467,6 +467,7 @@ parse_proxy(char *proxy, char *host) } else if (!isspace(*cur)) *c++ = *cur; } + *c = '\0'; *++p = NULL; return pargv; } @@ -487,8 +488,12 @@ pop_init (char *host, char *port, char *user, char *pass, char *proxy, int inpipe[2]; /* for reading from the server */ int outpipe[2]; /* for sending to the server */ - pipe(inpipe); - pipe(outpipe); + if (pipe(inpipe) < 0) { + adios ("inpipe", "pipe"); + } + if (pipe(outpipe) < 0) { + adios ("outpipe", "pipe"); + } pid=fork(); if (pid==0) { @@ -895,7 +900,7 @@ sasl_getline (char *s, int n, FILE *iop) *p = 0; if (*--p == '\n') *p = 0; - if (*--p == '\r') + if (p > s && *--p == '\r') *p = 0; return OK; @@ -932,7 +937,9 @@ putline (char *s, FILE *iop) return NOTOK; } - fwrite(buf, buflen, 1, iop); + if (fwrite(buf, buflen, 1, iop) < 1) { + advise ("putline", "fwrite"); + } } #endif /* CYRUS_SASL */