ph10 2006/12/19 15:09:59 GMT
Modified files:
exim-doc/doc-txt ChangeLog
exim-src/src exim_dbmbuild.c
Log:
Check for a ridiculously long filename in exim_dbmbuild.
Revision Changes Path
1.447 +2 -0 exim/exim-doc/doc-txt/ChangeLog
1.7 +11 -2 exim/exim-src/src/exim_dbmbuild.c
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.446
retrieving revision 1.447
diff -u -r1.446 -r1.447
--- ChangeLog 19 Dec 2006 14:51:34 -0000 1.446
+++ ChangeLog 19 Dec 2006 15:09:58 -0000 1.447
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.446 2006/12/19 14:51:34 ph10 Exp $
+$Cambridge: exim/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
-------------------------------------------
@@ -356,6 +356,8 @@
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
Index: exim_dbmbuild.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/exim_dbmbuild.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- exim_dbmbuild.c 7 Feb 2006 11:19:00 -0000 1.6
+++ exim_dbmbuild.c 19 Dec 2006 15:09:58 -0000 1.7
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/exim_dbmbuild.c,v 1.6 2006/02/07 11:19:00 ph10 Exp $ */
+/* $Cambridge: exim/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_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);
@@ -194,6 +194,15 @@
exit(1);
}
#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");