rasmus Tue Apr 1 14:10:35 2003 EDT Modified files: (Branch: PHP_4_3) /php4 TODO_SEGFAULTS /php4/ext/dbase dbf_head.c Log: Argh!!! I guess nobody has ever looked at this code. Index: php4/TODO_SEGFAULTS diff -u php4/TODO_SEGFAULTS:1.1.2.6 php4/TODO_SEGFAULTS:1.1.2.7 --- php4/TODO_SEGFAULTS:1.1.2.6 Tue Apr 1 13:47:01 2003 +++ php4/TODO_SEGFAULTS Tue Apr 1 14:10:35 2003 @@ -7,13 +7,13 @@ i18n_convert/mb_convert_encoding (Moriyoshi Koizumi) socket_iovec_alloc (Rasmus) exif_imagetype,exif_thumbnail (Rasmus) + dbase_open (Rasmus) Open: array_pad bcsub (1) - dbase_open mb_ereg (2) mb_ereg_match (2) mb_eregi (2) Index: php4/ext/dbase/dbf_head.c diff -u php4/ext/dbase/dbf_head.c:1.10.8.1 php4/ext/dbase/dbf_head.c:1.10.8.2 --- php4/ext/dbase/dbf_head.c:1.10.8.1 Fri Dec 13 11:54:49 2002 +++ php4/ext/dbase/dbf_head.c Tue Apr 1 14:10:35 2003 @@ -247,9 +247,10 @@ cp = dp; if ((fd = VCWD_OPEN(cp, o_flags|O_BINARY)) < 0) { - cp = (char *)malloc(256); - strcpy(cp, dp); strcat(cp, ".dbf"); + cp = (char *)malloc(MAXPATHLEN); /* So where does this get free()'d? -RL */ + strncpy(cp, dp, MAXPATHLEN-5); strcat(cp, ".dbf"); if ((fd = VCWD_OPEN(cp, o_flags)) < 0) { + free(cp); perror("open"); return NULL; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php