php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50770 Incorrect date and boolean lengths when writing header
Submitted: 2010-01-15 16:20 UTC Modified: 2010-10-12 00:57 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: sergio at entrecables dot com Assigned: alan_k (profile)
Status: Closed Package: dBase related
PHP Version: 5.*, 6 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sergio at entrecables dot com
New email:
PHP Version: OS:

 

 [2010-01-15 16:20 UTC] sergio at entrecables dot com
Description:
------------
Rev 246377
(http://svn.php.net:80/viewvc?view=revision&revision=246377) in PECL
repository breaks writting dbase header with date or boolean fields,
because skip setting dbfield.dbf_flen

Adding "put_short(dbfield.dbf_flen, dbf->db_flen);" after setting
dbf->db_flen fixes it.


Patches

correct-date-header-lengths-dbf_head.c.patch (last revision 2010-09-28 11:24 UTC by kp at kll dot pl)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-15 16:22 UTC] sergio at entrecables dot com
I'm pasting the patch here because I can't see how to upload files

Index: dbf_head.c
===================================================================
--- dbf_head.c  (revisi�n: 293584)
+++ dbf_head.c  (copia de trabajo)
@@ -200,9 +200,11 @@
                break;
            case 'D':
                dbf->db_flen = 8;
+               put_short(dbfield.dbf_flen, dbf->db_flen);
                break;
            case 'L':
                dbf->db_flen = 1;
+               put_short(dbfield.dbf_flen, dbf->db_flen);
                break;
            default:
                put_short(dbfield.dbf_flen, dbf->db_flen);
 [2010-09-28 13:34 UTC] kp at kll dot pl
Thanks for sergio at entrecables dot com
I have added patch which works well.

Im surprised that it is not solved yet.

Developers please add this patch into buggy source!
 [2010-09-28 13:42 UTC] kp at kll dot pl
Oh.. 
This bug (and patch) is related with PHP 5.3.2 and earlier 5.3 versions.
 [2010-10-12 00:57 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: alan_k
 [2010-10-12 00:57 UTC] felipe@php.net
Already fixed in the PECL repository.
http://svn.php.net/viewvc?view=revision&revision=304302
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 17:01:33 2025 UTC