diff options
| author | Rasmus Lerdorf <rasmus@php.net> | 2003-04-01 19:10:35 +0000 |
|---|---|---|
| committer | Rasmus Lerdorf <rasmus@php.net> | 2003-04-01 19:10:35 +0000 |
| commit | 8ff4b6730732a00cc4be65d9c5d94a034c72252d (patch) | |
| tree | 7f980b6a1288e899ed28e452fc15b45e912b0535 /ext | |
| parent | 14aa0e7495ac312e2eec481beab84341ca23d415 (diff) | |
| download | php-git-8ff4b6730732a00cc4be65d9c5d94a034c72252d.tar.gz | |
Argh!!! I guess nobody has ever looked at this code.
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/dbase/dbf_head.c | 5 |
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; } |
