|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5112 dbase_create broken.. Here is a quick fix.
Submitted: 2000-06-18 23:54 UTC Modified: 2000-07-01 23:22 UTC
From: rezbin at yahoo dot com Assigned:
Status: Closed Package: dBase related
PHP Version: 4.0 Latest CVS (18/06/2000) OS: Linux 2.2.13
Private report: No CVE-ID: None
 [2000-06-18 23:54 UTC] rezbin at yahoo dot com
There is a problem with dbase_create in that it fails to recongnize the 2nd parameter as being an array of arrays.

I have done some digging, and found a solution to the problem, albet just a quick-fix it does do the trick.

First thing to do is apply the quick patch to the dbase.c file that is mentioned in bug ID: 4813, that will remove the page fault problems.

The way to get the function to work is this:
on the line 569:
  pval *filename, *fields, *field, *value;
make it read:
  pval *filename, *fields, *field, *value, **tmp;

On line 626 change:
  if (zend_hash_index_find(fields->, i, (void **)&field) == FAILURE) {
to read:
  if (zend_hash_index_find(fields->, i, (void **)&tmp) == FAILURE) {

Add the fallowing to line 631:
  field = *val;

repeate this method for the other references to function zend_hash_index_find, in dbase_create and it'll work just fine.

It looks like something has changed between PHP3 and PHP4, which must of broke the function.

Config line used: ./configure --with-mysql --with-apxs --enable-dbase --disable-debug


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-01 23:22 UTC] sterling at cvs dot php dot net
Fixed in CVS.  Thanks.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 13:01:30 2024 UTC