php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52099 fdf_get_value max size
Submitted: 2010-06-16 17:27 UTC Modified: 2010-08-16 04:27 UTC
From: carrieraglan at gmail dot com Assigned:
Status: Wont fix Package: FDF related
PHP Version: 5.2.10 OS: Windows
Private report: No CVE-ID: None
 [2010-06-16 17:27 UTC] carrieraglan at gmail dot com
Description:
------------
if fdf_set_value is set with a string of 255 characters nothing is returned when using fdf_get_value

Test script:
---------------
<?

$outfdf = fdf_create();

$value = 'PAINT (including paint, lacquer, enamel, stain, shellac, varnish, polish, liquid filler and liquid lacquer base) with not more than 20 per cent nitrocellulose by mass if the nitrogen content of the nitrocellulose is not more than 12.6 per cent by mass; or';
fdf_set_value($outfdf, 'Stringof255characters', $value, 0);
print "Test1: ";
print fdf_get_value($outfdf, 'Stringof255characters'); //prints ''

print "<br>";

$value = substr($value,0,253);
fdf_set_value($outfdf, 'Stringof253characters', $value, 0);
print "Test2: ";
print fdf_get_value($outfdf, 'Stringof253characters'); //prints the 253 characters of the string

?>

Expected result:
----------------
both print fdf_get_value should print the value of the string

Actual result:
--------------
if fdf_set_value is set with a string of 255 characters nothing is returned when using fdf_get_value

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-16 17:31 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2010-06-16 17:31 UTC] pajoye@php.net
FDF is not included in php anymore, do you mean 5.2.13?
 [2010-06-16 21:35 UTC] carrieraglan at gmail dot com
-Status: Feedback +Status: Open -PHP Version: 5.3.2 +PHP Version: 5.2.10
 [2010-06-16 21:35 UTC] carrieraglan at gmail dot com
version should be 5.2.10
 [2010-08-16 04:27 UTC] kalle@php.net
-Status: Open +Status: Wont fix
 [2010-08-16 04:27 UTC] kalle@php.net
Digging somewhat into this, the allocated buffer is "too short" according to fdftk and when it tries to realloc the memory (256b + 2b) its still too short and bails. Could be a bug in fdf, but since fdf is not actively developed anymore then I'll mark this as a Won't fix as 5.2 is only in security fixes mode only
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC