cvs: php-src(PHP_5_2) /ext/dbase dbf_head.c dbf_rec.c

From: Date: Sat, 24 Feb 2007 18:00:43 +0000
Subject: cvs: php-src(PHP_5_2) /ext/dbase dbf_head.c dbf_rec.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-43263@lists.php.net to get a copy of this message
iliaa Sat Feb 24 18:00:43 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/dbase dbf_head.c dbf_rec.c Log: strncpy() -> strlcpy() http://cvs.php.net/viewvc.cgi/php-src/ext/dbase/dbf_head.c?r1=1.14.4.1.2.4&r2=1.14.4.1.2.5&diff_format=u Index: php-src/ext/dbase/dbf_head.c diff -u php-src/ext/dbase/dbf_head.c:1.14.4.1.2.4 php-src/ext/dbase/dbf_head.c:1.14.4.1.2.5 --- php-src/ext/dbase/dbf_head.c:1.14.4.1.2.4 Sat Feb 24 02:17:24 2007 +++ php-src/ext/dbase/dbf_head.c Sat Feb 24 18:00:43 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); dbfield.dbf_type = dbf->db_type; switch (dbf->db_type) { http://cvs.php.net/viewvc.cgi/php-src/ext/dbase/dbf_rec.c?r1=1.10&r2=1.10.6.1&diff_format=u Index: php-src/ext/dbase/dbf_rec.c diff -u php-src/ext/dbase/dbf_rec.c:1.10 php-src/ext/dbase/dbf_rec.c:1.10.6.1 --- php-src/ext/dbase/dbf_rec.c:1.10 Thu Nov 27 10:15:20 2003 +++ php-src/ext/dbase/dbf_rec.c Sat Feb 24 18:00:43 2007 @@ -152,8 +152,7 @@ if ( !cp ) cp = (char *)malloc(flen + 1); if ( cp ) { - strncpy(cp, &rp[fldp->db_foffset], flen); - cp[flen] = 0; + strlcpy(cp, &rp[fldp->db_foffset], flen + 1); } return cp; }

« previous php.cvs (#43263) next »