]> granicus.if.org Git - php/commitdiff
MFH: fix #41394 (dbase_create creates file with corrupted header)
authorAntony Dovgal <tony2001@php.net>
Wed, 16 May 2007 13:17:50 +0000 (13:17 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 16 May 2007 13:17:50 +0000 (13:17 +0000)
NEWS
ext/dbase/dbf_head.c

diff --git a/NEWS b/NEWS
index 9edc9b953631d0e601f0566072a7721c0c1ddbca..0e1fae144af1ab17da6e250e7101eb896a7b8d0c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ PHP                                                                        NEWS
 - Fixed segfault in strripos(). (Tony, Joxean Koret)
 - Fixed bug #41403 (json_decode cannot decode floats if localeconv 
   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).
   (Scott)
 - Fixed bug #41378 (fastcgi protocol lacks support for Reason-Phrase in 
index 0f9ad61461ebe5424eb2922d373bb5d12f4d70f0..33e3a425d742b3609b5e653a8259fc5c2154c06c 100644 (file)
@@ -184,7 +184,7 @@ int put_dbf_field(dbhead_t *dbh, dbfield_t *dbf)
        /* build the on disk field info */
        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;
        switch (dbf->db_type) {
@@ -215,7 +215,7 @@ void put_dbf_info(dbhead_t *dbh)
        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);