summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Kistner <tom@duncanthrax.net>2009-10-13 18:32:05 +0000
committerTom Kistner <tom@duncanthrax.net>2009-10-13 18:32:05 +0000
commitcf7453055ad53ee3d2ee7b790ee83168ce58412d (patch)
tree5cbf4df9b7510937e58994830dd184ffeef38c7c /src
parent1a9312b26a4e52e2a95bbb658897891011c9080a (diff)
Bugzilla #890
Diffstat (limited to 'src')
-rw-r--r--src/src/dkim.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/src/dkim.c b/src/src/dkim.c
index 63140e854..3109168a3 100644
--- a/src/src/dkim.c
+++ b/src/src/dkim.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/dkim.c,v 1.3 2009/08/31 21:14:50 tom Exp $ */
+/* $Cambridge: exim/src/src/dkim.c,v 1.4 2009/10/13 18:32:05 tom Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -456,7 +456,13 @@ uschar *dkim_exim_sign(int dkim_fd,
/* Looks like a filename, load the private key. */
memset(big_buffer,0,big_buffer_size);
privkey_fd = open(CS dkim_private_key,O_RDONLY);
- (void)read(privkey_fd,big_buffer,16383);
+ if (privkey_fd < 0) {
+ log_write(0, LOG_MAIN|LOG_PANIC, "unable to open "
+ "private key file for reading: %s", dkim_private_key);
+ rc = NULL;
+ goto CLEANUP;
+ }
+ (void)read(privkey_fd,big_buffer,(big_buffer_size-2));
(void)close(privkey_fd);
dkim_private_key = big_buffer;
}