tony2001 Wed May 16 13:16:57 2007 UTC Modified files: /php-src/ext/dbase dbf_head.c Log: fix #41394 (dbase_create creates file with corrupted header) http://cvs.php.net/viewvc.cgi/php-src/ext/dbase/dbf_head.c?r1=1.19&r2=1.20&diff_format=u Index: php-src/ext/dbase/dbf_head.c diff -u php-src/ext/dbase/dbf_head.c:1.19 php-src/ext/dbase/dbf_head.c:1.20 --- php-src/ext/dbase/dbf_head.c:1.19 Sat Feb 24 16:25:53 2007 +++ php-src/ext/dbase/dbf_head.c Wed May 16 13:16:56 2007 @@ -184,7 +184,7 @@ /* build the on disk field info */ scp = dbf->db_fname; dcp = dbfield.dbf_name; - strncpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN); + strlcpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN + 1); dbfield.dbf_type = dbf->db_type; switch (dbf->db_type) { @@ -215,7 +215,7 @@ int fcnt; if ((cp = db_cur_date(NULL))) { - strlcpy(dbh->db_date, cp, 8); + strlcpy(dbh->db_date, cp, 9); free(cp); } put_dbf_head(dbh);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php