php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8394 pdf_open_image_file() makes PHP segfault
Submitted: 2000-12-23 23:28 UTC Modified: 2001-01-03 10:03 UTC
From: troels at arvin dot dk Assigned:
Status: Closed Package: PDF related
PHP Version: 4.0.4 OS: Linux
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: troels at arvin dot dk
New email:
PHP Version: OS:

 

 [2000-12-23 23:28 UTC] troels at arvin dot dk
In PHP 4.0.4, pdf_open_image_file() makes PHP segfault.

Things work fine in PHP 4.0.3pl1 with the exact same code and the exact same image. It doesn't matter if pdf_open_image_file() is used with either PNG og JPEG images.

Other PHP-PDFlib functions seem to work well.

At http://troels.arvin.dk/php-bugs/pdf/ I have put all relevant information:
 - The configure-command used
 - Output from the configure-command
 - Demonstration script code and demonstration image
 - GDB-backtrace

For bug isolation, I compiled PHP in the CGI-version with the following configure-switches:
./configure \
        --with-pdflib \
        --without-mysql \
        --disable-session \
        --disable-xml \
        --without-pcre-regex \
        --with-ttf \
        --with-gd \
        --enable-debug

It doesn't help if a more involved configure statement (adding --with-png-dir=..., etc.) is used.

Involved software
------------------------
Operating system: Red Hat Linux 7 (on a PIII CPU system) with all official updates.
(The problem also seems to exist on Red Hat 6.2 hosts).

PDFlib: V. 3.02

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-28 11:42 UTC] troels@php.net
The patch at
http://rpms.arvin.dk/php/source/patches/php-pdf.c.patch
stops the segfauling on Linux. But it will probably result
in segfaults in Windows.

The patch is mostly a port of PHP 3.0.4pl1's pdf.c code.

I'w wondering how virtual_filepath() is meant to be used. In
swf.c and gdttf.c, it's used like this:

#ifdef VIRTUAL_DIR
    // This seems to imply Windows?
    if (virtual_filepath(aaa, &bbb)) {
	// do something if the file isn't there
        return NULL;
    } else {
        // the file is there; do something
    }
#else
    // This seems to imply unix?
    ....
#endif


 [2001-01-03 10:03 UTC] dbeu@php.net
fixed in cvs
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 18:01:31 2024 UTC