cvs: php4 /ext/dbase dbf_head.c
| From: | Rasmus Lerdorf | Date: | Tue, 01 Apr 2003 19:12:32 +0000 |
| Subject: | cvs: php4 /ext/dbase dbf_head.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-19947@lists.php.net to get a copy of this message | ||
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;
}