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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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)

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 00:01:30 2024 UTC