php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11769 PDF_setcolor (invalid type of the third argument)
Submitted: 2001-06-28 05:03 UTC Modified: 2001-06-28 13:46 UTC
From: cedric dot scheyder at alcatel dot fr Assigned:
Status: Closed Package: PDF related
PHP Version: 4.0.5 OS: Solaris 2.8
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cedric dot scheyder at alcatel dot fr
New email:
PHP Version: OS:

 

 [2001-06-28 05:03 UTC] cedric dot scheyder at alcatel dot fr
PHP_FUNCTION(pdf_setcolor) {
        zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
        PDF *pdf;




        float c1;     <========== TO BE MODIFIED !!!!!!!!!! (replace the int by a float)




        if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7) == FAILURE) {
                WRONG_PARAM_COUNT;
        }

        ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);

        convert_to_string_ex(arg2);
        convert_to_string_ex(arg3);
        convert_to_double_ex(arg4);
        convert_to_double_ex(arg5);
        convert_to_double_ex(arg6);
        convert_to_double_ex(arg7);

        if (0 == (strcmp(Z_STRVAL_PP(arg3), "spot"))) {
            c1 = (int) Z_DVAL_PP(arg4)-PDFLIB_SPOT_OFFSET;
        } else if(0 == (strcmp(Z_STRVAL_PP(arg3), "pattern"))) {
            c1 = (int) Z_DVAL_PP(arg4)-PDFLIB_PATTERN_OFFSET;
        } else {
            c1 = (float) Z_DVAL_PP(arg4);
        }

        PDF_setcolor(pdf,
                Z_STRVAL_PP(arg2),
                Z_STRVAL_PP(arg3),
                (float) c1,
                (float) Z_DVAL_PP(arg5),
                (float) Z_DVAL_PP(arg6),
                (float) Z_DVAL_PP(arg7));

        RETURN_TRUE;
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-28 05:06 UTC] cedric dot scheyder at alcatel dot fr
in pdf.c file:

            PHP_FUNCTION(pdf_setcolor) {
                    zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
                    PDF *pdf;



                    /* int c1;  */
                    float c1;     <========== TO BE MODIFIED !!!!!!!!!! (replace the int by a
            float)




                    if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &arg1, &arg2,
            &arg3, &arg4, &arg5, &arg6, &arg7) == FAILURE) {
                            WRONG_PARAM_COUNT;
                    }

                    ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);

                    convert_to_string_ex(arg2);
                    convert_to_string_ex(arg3);
                    convert_to_double_ex(arg4);
                    convert_to_double_ex(arg5);
                    convert_to_double_ex(arg6);
                    convert_to_double_ex(arg7);

                    if (0 == (strcmp(Z_STRVAL_PP(arg3), "spot"))) {
                        c1 = (int) Z_DVAL_PP(arg4)-PDFLIB_SPOT_OFFSET;
                    } else if(0 == (strcmp(Z_STRVAL_PP(arg3), "pattern"))) {
                        c1 = (int) Z_DVAL_PP(arg4)-PDFLIB_PATTERN_OFFSET;
                    } else {
                        c1 = (float) Z_DVAL_PP(arg4);
                    }

                    PDF_setcolor(pdf,
                            Z_STRVAL_PP(arg2),
                            Z_STRVAL_PP(arg3),
                            (float) c1,
                            (float) Z_DVAL_PP(arg5),
                            (float) Z_DVAL_PP(arg6),
                            (float) Z_DVAL_PP(arg7));

                    RETURN_TRUE;
            }
 [2001-06-28 13:46 UTC] sniper@php.net
Fixed in PHP 4.0.6 


 [2011-11-07 16:16 UTC] nikic@php.net
Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=318884
Log: Fix typos

--
Provided by anonymous #11769 (Laurent.Lyaudet@gmail.com)
 [2012-02-13 20:10 UTC] tularis@php.net
Automatic comment from SVN on behalf of tularis
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=323196
Log: Fixed a number of typo's

--
Provided by anonymous #11769 (Laurent.Lyaudet@gmail.com)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC