summaryrefslogtreecommitdiff
path: root/imap/src/osdep/unix
diff options
context:
space:
mode:
Diffstat (limited to 'imap/src/osdep/unix')
-rw-r--r--imap/src/osdep/unix/Makefile1
-rw-r--r--imap/src/osdep/unix/ssl_unix.c8
2 files changed, 4 insertions, 5 deletions
diff --git a/imap/src/osdep/unix/Makefile b/imap/src/osdep/unix/Makefile
index 7b1bff38..a30e8d51 100644
--- a/imap/src/osdep/unix/Makefile
+++ b/imap/src/osdep/unix/Makefile
@@ -1003,6 +1003,7 @@ onceenv:
./drivers $(EXTRADRIVERS) $(DEFAULTDRIVERS) dummy
./mkauths $(EXTRAAUTHENTICATORS) $(DEFAULTAUTHENTICATORS)
echo " mail_versioncheck (CCLIENTVERSION);" >> linkage.c
+ sh -c '(test $(SSLTYPE) != none) && echo "int pith_ssl_encryption_version(char *);" >> linkage.h || true'
$(LN) os_$(OS).h osdep.h
$(LN) os_$(OS).c osdepbas.c
$(LN) log_$(LOGINPW).c osdeplog.c
diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c
index 020cfd77..93fb1a9a 100644
--- a/imap/src/osdep/unix/ssl_unix.c
+++ b/imap/src/osdep/unix/ssl_unix.c
@@ -636,20 +636,18 @@ char *ssl_getsize (SSLSTREAM *stream, unsigned long size)
{
char *ret = NIL;
unsigned long got = 0L, need = size, n;
- int done = 0;
- while(!done){
+ do {
if(!ssl_getdata (stream)) return ret; /* return what we have */
n = stream->ictr < need ? stream->ictr : need;
- fs_resize((void **) &ret, got + n + 1);
+ fs_resize((void **) &ret, (got + n + 1)*sizeof(char));
memcpy(ret + got, stream->iptr, n);
ret[got+n] = '\0';
got += n;
need -= n;
stream->iptr += n;
stream->ictr -= n;
- if(need == 0L) done++;
- }
+ } while (need > 0);
return ret;
}