ID: 21533 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: GD related Operating System: RH 7.2 PHP Version: 4.3.0 New Comment:
I would like to help you, but it would take some time to get my server back in the state where the error was occurring. I have since installed FreeType 2.x so that now things do build and work correctly. So, I can't confirm the fact that the crash would go away. But, since variable "error" is undefined, it easily could cause a crash. Certainly initializing it to NULL would improve the "random" nature of undefined variables. My original post was meant to help out the development of PHP by relaying my experience and pointing to specific lines of code that seem problematic. There is clearly a mistake in the gd.c code. You may choose not to do anything about it. And, it may not affect too many installations, but any decent software engineer would say that the code is risky at best. Previous Comments: ------------------------------------------------------------------------ [2003-01-22 17:08:34] [EMAIL PROTECTED] If you change char *error; to char *error = NULL; does the segmentation fault you are seeing go away? ------------------------------------------------------------------------ [2003-01-22 13:57:11] [EMAIL PROTECTED] The version of gd.c that I have is supposed to be 4.3.0. I still believe it is incorrect. If you are referring to the statement: Line 2951: #else /* !USE_GD_IMGSTRTTF */ that 'else' is related to a "USE_GD_IMGSTRTTF" and is not the same as any "HAVE_GD_STRINGxxx" defines. I'm saying that if USE_GD_IMGSTRTTF *is* defined, but neither HAVE_GD_STRINGFT nor HAVE_GD_STRINGTTF is defined, it will leave the variable 'error' undefined, and then try to use it (resulting in the possibility of a crash). Do you still disagree? ------------------------------------------------------------------------ [2003-01-21 14:20:13] [EMAIL PROTECTED] The ifdef is correct, because no matter what the value will be assigned to error. There is another ifdef surrounding this code which has an else condition that is used to set a value to error. So the crash you are seeing comes from elsewhere. ------------------------------------------------------------------------ [2003-01-21 09:28:38] [EMAIL PROTECTED] PHP build: configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --enable-track-vars --with-imap=/usr/local/imap --with-gd --enable-ftp --enable-sysvsem --enable-sysvshm --enable-sockets --with-gettext --with-mm=/usr/local/lib/mm --with-jpeg-dir=/usr/lib --with-zlib-dir=/usr/local --with-openssl=/usr/local/ssl --with-ttf --enable-gd-native-ttf --enable-gd-imgstrttf --with-freetype-dir=/usr/local --with-dom FreeType: freetype-1.3.1.tar.gz was untarred and built and installed with: configure make make install ------------------------------------------------------------------------ [2003-01-20 17:11:22] [EMAIL PROTECTED] What was the configure line ? And exactly what freetype 1.x version was installed? And how? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21533 -- Edit this bug report at http://bugs.php.net/?id=21533&edit=1