[exim-dev] exim_dbmbuild buffer overflow

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: alberto barbaro
Ημερομηνία:  
Προς: exim-dev
Αντικείμενο: [exim-dev] exim_dbmbuild buffer overflow
Hi. I found this small bug:

sh-2.05b$ echo "a" > a.txt && exim_dbmbuild a.txt `perl -e 'print"A"x5000'`
Segmentation fault
sh-2.05b$

/*************************************************
*               Main Program                     *
*************************************************/


int main(int argc, char **argv)
{
int started;
int count = 0;
int dupcount = 0;
int yield = 0;
int arg = 1;
int add_zero = 1;
BOOL lowercase = TRUE;
BOOL warn = TRUE;
BOOL duperr = TRUE;
BOOL lastdup = FALSE;
#if !defined (USE_DB) && !defined(USE_TDB) && !defined(USE_GDBM)
int is_db = 0;
struct stat statbuf;
#endif
FILE *f;
EXIM_DB *d;
EXIM_DATUM key, content;
uschar *bptr;
uschar  keybuffer[256];
uschar  temp_dbmname[256];
uschar  real_dbmname[256];
uschar *buffer = malloc(max_outsize);
uschar *line = malloc(max_insize);
.
.
.
Ustrcpy(temp_dbmname, argv[arg+1]);    <--- needs more control
Ustrcat(temp_dbmname, ".dbmbuild_temp");


Please write me back soon

Khlero