rasmus Tue Apr 1 14:12:32 2003 EDT
Modified files:
/php4/ext/dbase dbf_head.c
Log:
MFB
Index: php4/ext/dbase/dbf_head.c
diff -u php4/ext/dbase/dbf_head.c:1.11 php4/ext/dbase/dbf_head.c:1.12
--- php4/ext/dbase/dbf_head.c:1.11 Thu Dec 12 22:09:52 2002
+++ php4/ext/dbase/dbf_head.c Tue Apr 1 14:12:32 2003
@@ -247,9 +247,10 @@
cp = dp;
if ((fd = VCWD_OPEN(cp, o_flags|O_BINARY)) < 0) {
- cp = (char *)malloc(256);
- strcpy(cp, dp); strcat(cp, ".dbf");
+ cp = (char *)malloc(MAXPATHLEN); /* So where does this get free()'d?
-RL */
+ strncpy(cp, dp, MAXPATHLEN-5); strcat(cp, ".dbf");
if ((fd = VCWD_OPEN(cp, o_flags)) < 0) {
+ free(cp);
perror("open");
return NULL;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php