|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
34 - 33 = ?
Subscribe to this entry?

 [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 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 \

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-28 11:42 UTC]
The patch at
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:

    // 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
    // This seems to imply unix?

 [2001-01-03 10:03 UTC]
fixed in cvs
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 19:01:33 2024 UTC