php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44850 dbase_open exits with error
Submitted: 2008-04-28 00:26 UTC Modified: 2008-07-25 01:00 UTC
From: kindaian at gmail dot com Assigned:
Status: No Feedback Package: dBase related
PHP Version: 5.2.5 OS: Windows XP Pro
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-04-28 00:26 UTC] kindaian at gmail dot com
Description:
------------
I've a dbf with a problem in the array that holds the field definitions, so when i try to open it it crashes.

I've tryed to open it in DBU and when i try to access the fields, it exits with "BASE/1132 bound error: array access".

In PHP, it just exits with an error that it can't open the file and stops execution ("Error reading DBF's number of fields").

The problem is that I've the code enclosed by a try/catch and the program instead of gracefully execute the catch... just breaks.

Maybe related with the way error handling is handled inside the dbase functions as pointed out also in the bug #37589 "dbase_open doesnt act like it should" for another issue.

Reproduce code:
---------------
try {
	$dbf = @dbase_open($file_name, 0); 
} catch (Exception $e) {
	echo ("Error opening $file_name");
}

Expected result:
----------------
I was expecting that the program would print the error message and carry on.

Actual result:
--------------
The execution just stops where the error happens, and no more code is processed.

The error "Error reading DBF's number of fields" is shown in the browser.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-28 01:00 UTC] kindaian at gmail dot com
This is the begin (the 256 first characters) of the file (changed the record number to 1 and the terminator character to 0D, but it didn't sorted it out):

03 6C 04 02 01 00 00 00 81 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 4F 44 49 47 4F 00 00 00 00 00 43 00 00 00 00 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 45 53 43 52 49 43 41 4F 00 00 43 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 45 53 43 5F 41 55 58 00 00 00 43 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0D 20 36 30 30 2F 30 2C 39 30 20 20 41 55 54 4F 20 41 44 45 53 49 56 41 2C 20 32 20 54 45 4C 41 53 2C 20 30 2C 39 30 20 4D 4D 20 20 20 20 20 20 20 20 20 20 53 54 49 43 4B 59 20 42 41 43 4B 2C 20 30 2C 39 30 20 6D 6D 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 36 30 30 2F 30 2C 39 35 20 20 41 55 54 4F 20 41 44 45 53 49 56 41 2C 20 32 20 54 45 4C 41 53 2C 20 30
 [2008-07-25 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Apr 10 13:01:24 2020 UTC