summaryrefslogtreecommitdiff
path: root/imap/src/c-client/auth_md5.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2016-08-11 21:14:43 -0600
committerEduardo Chappa <chappa@washington.edu>2016-08-11 21:14:43 -0600
commitaa5a0714e2ae3c401ac9e6901dde87ad70568d8c (patch)
tree77499e2bf845fe982004d88fb42a71ed8a15ccd7 /imap/src/c-client/auth_md5.c
parent3d3df2b3153af567b6b17c05052ab21e9b2e9a00 (diff)
downloadalpine-aa5a0714e2ae3c401ac9e6901dde87ad70568d8c.tar.xz
* Protect all calls to mail_elt in pith/ and alpine/ code. Protect means
to check for correct range of message number before calling mail_elt. * Work in progress: correct some uses of system calls that do not check for returned value. This work will follow the lead given by Christian Kujau and Asheesh Laroia. Expect more changes of this type in subsequent commits.
Diffstat (limited to 'imap/src/c-client/auth_md5.c')
-rw-r--r--imap/src/c-client/auth_md5.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/imap/src/c-client/auth_md5.c b/imap/src/c-client/auth_md5.c
index 9c81d308..8c989769 100644
--- a/imap/src/c-client/auth_md5.c
+++ b/imap/src/c-client/auth_md5.c
@@ -1,3 +1,7 @@
+/*
+ * Copyright 2016 - Eduardo Chappa
+ * Last Modified: August 11, 2016
+ */
/* ========================================================================
* Copyright 2008-2011 Mark Crispin
* ========================================================================
@@ -191,7 +195,8 @@ char *auth_md5_pwd (char *user)
char *ret = NIL;
if (fd >= 0) { /* found the file? */
fstat (fd,&sbuf); /* yes, slurp it into memory */
- read (fd,buf = (char *) fs_get (sbuf.st_size + 1),sbuf.st_size);
+ if(read (fd,buf = (char *) fs_get (sbuf.st_size + 1),sbuf.st_size) < 0)
+ fatal("error on read() call in auth_md5_pwd");
/* see if any uppercase characters in user */
for (s = user; *s && ((*s < 'A') || (*s > 'Z')); s++);
/* yes, make lowercase copy */