summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2006-12-19 15:09:58 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2006-12-19 15:09:58 +0000
commita0540757464b5ffb4d1f023fdc311839b1a034dc (patch)
tree881c6cf2701b1d8615e1a5919bea4df8897c89d0
parent21eb6e72d6d616a6430e1346e085b7cc74298f88 (diff)
Check for a ridiculously long filename in exim_dbmbuild.
-rw-r--r--doc/doc-txt/ChangeLog4
-rw-r--r--src/src/exim_dbmbuild.c15
2 files changed, 15 insertions, 4 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 1a8a1af5d..5932ad785 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.446 2006/12/19 14:51:34 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.447 2006/12/19 15:09:58 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -357,6 +357,8 @@ PH/53 Added missing "#include <time.h>" to pcre/pcretest.c (this was a PCRE
PH/54 Applied Robert Bannocks' patch to avoid a problem with references that
arises when using the Solaris LDAP libraries (but not with OpenLDAP).
+PH/55 Check for a ridiculously long file name in exim_dbmbuild.
+
Exim version 4.63
-----------------
diff --git a/src/src/exim_dbmbuild.c b/src/src/exim_dbmbuild.c
index f34448dd3..0e3618b53 100644
--- a/src/src/exim_dbmbuild.c
+++ b/src/src/exim_dbmbuild.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/exim_dbmbuild.c,v 1.6 2006/02/07 11:19:00 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim_dbmbuild.c,v 1.7 2006/12/19 15:09:58 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -151,8 +151,8 @@ EXIM_DB *d;
EXIM_DATUM key, content;
uschar *bptr;
uschar keybuffer[256];
-uschar temp_dbmname[256];
-uschar real_dbmname[256];
+uschar temp_dbmname[512];
+uschar real_dbmname[512];
uschar *buffer = malloc(max_outsize);
uschar *line = malloc(max_insize);
@@ -195,6 +195,15 @@ if (Ustrcmp(argv[arg], argv[arg+1]) == 0)
}
#endif
+/* Check length of filename; allow for adding .dbmbuild_temp and .db or
+.dir/.pag later. */
+
+if (strlen(argv[arg+1]) > sizeof(temp_dbmname) - 20)
+ {
+ printf("exim_dbmbuild: output filename is ridiculously long\n");
+ exit(1);
+ }
+
Ustrcpy(temp_dbmname, argv[arg+1]);
Ustrcat(temp_dbmname, ".dbmbuild_temp");