summaryrefslogtreecommitdiff
path: root/ext/dbase
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2003-04-01 19:12:32 +0000
committerRasmus Lerdorf <rasmus@php.net>2003-04-01 19:12:32 +0000
commit20ea550235ccb8feaa7a520327cdad11ae023cf0 (patch)
tree9877d42d61f3270b0f0ad5fa19c65a270368dc0e /ext/dbase
parentb30282417126509ccaf0ddb0e4519403377e8f06 (diff)
downloadphp-git-20ea550235ccb8feaa7a520327cdad11ae023cf0.tar.gz
MFB
Diffstat (limited to 'ext/dbase')
-rw-r--r--ext/dbase/dbf_head.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/dbase/dbf_head.c b/ext/dbase/dbf_head.c
index afaa0d724d..9ec1f40d6c 100644
--- a/ext/dbase/dbf_head.c
+++ b/ext/dbase/dbf_head.c
@@ -247,9 +247,10 @@ dbhead_t *dbf_open(char *dp, int o_flags TSRMLS_DC)
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;
}