MFH: fix #41394 (dbase_create creates file with corrupted header)

This commit is contained in:
Antony Dovgal 2007-05-16 13:17:50 +00:00
parent 09a575a20f
commit 3a10e5c078
2 changed files with 3 additions and 2 deletions

1
NEWS
View file

@ -12,6 +12,7 @@ PHP NEWS
- Fixed segfault in strripos(). (Tony, Joxean Koret) - Fixed segfault in strripos(). (Tony, Joxean Koret)
- Fixed bug #41403 (json_decode cannot decode floats if localeconv - Fixed bug #41403 (json_decode cannot decode floats if localeconv
decimal_point is not '.'). (Tony) decimal_point is not '.'). (Tony)
- Fixed bug #41394 (dbase_create creates file with corrupted header). (Tony)
- Fixed bug #41390 (Clarify error message with invalid protocol scheme). - Fixed bug #41390 (Clarify error message with invalid protocol scheme).
(Scott) (Scott)
- Fixed bug #41378 (fastcgi protocol lacks support for Reason-Phrase in - Fixed bug #41378 (fastcgi protocol lacks support for Reason-Phrase in

View file

@ -184,7 +184,7 @@ int put_dbf_field(dbhead_t *dbh, dbfield_t *dbf)
/* build the on disk field info */ /* build the on disk field info */
scp = dbf->db_fname; dcp = dbfield.dbf_name; scp = dbf->db_fname; dcp = dbfield.dbf_name;
strlcpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN); strlcpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN + 1);
dbfield.dbf_type = dbf->db_type; dbfield.dbf_type = dbf->db_type;
switch (dbf->db_type) { switch (dbf->db_type) {
@ -215,7 +215,7 @@ void put_dbf_info(dbhead_t *dbh)
int fcnt; int fcnt;
if ((cp = db_cur_date(NULL))) { if ((cp = db_cur_date(NULL))) {
strlcpy(dbh->db_date, cp, 8); strlcpy(dbh->db_date, cp, 9);
free(cp); free(cp);
} }
put_dbf_head(dbh); put_dbf_head(dbh);