Patch patchstrlcpy.diff for dbase Bug #68289
Patch version 2014-10-23 07:00 UTC
Return to Bug #68289 |
Download this patch
Patch Revisions:
Developer: otto@drijf.net
diff -u dbase-5.1.0/dbf_rec.c dbase-5.1.0.fixed/dbf_rec.c
--- dbase-5.1.0/dbf_rec.c Wed Jun 13 03:44:07 2012
+++ dbase-5.1.0.fixed/dbf_rec.c Wed Oct 22 16:46:06 2014
@@ -152,7 +152,8 @@
if ( !cp )
cp = (char *)malloc(flen + 1);
if ( cp ) {
- strlcpy(cp, &rp[fldp->db_foffset], flen + 1);
+ strncpy(cp, &rp[fldp->db_foffset], flen);
+ cp[flen] = 0;
}
return cp;
}
|