[imp] RE: Apache segfault FIXED!

Speedfreak speedfreak50@netscape.net
Mon Oct 7 22:42:41 PDT 2002


Your only mistake was listening to me! ;)  I posted the wrong patch - 
the patch I posted is from the bug report and is for the cvs version 
of php.  Here's the patch against 4.2.3 - sorry 'bout that!  
So far no problems at all pounding on this with IE, Netscape, and 
Konqueror under Windows and Linux.

--------------------

diff -ru ext/pcre/php_pcre.c ext/pcre.new/php_pcre.c
--- ext/pcre/php_pcre.c Thu Feb 28 03:26:35 2002
+++ ext/pcre.new/php_pcre.c     Mon Oct  7 14:27:37 2002
@@ -64,6 +64,7 @@
        pefree(pce->re, 1);
 #if HAVE_SETLOCALE
        if ((void*)pce->tables) pefree((void*)pce->tables, 1);
+       pefree(pce->locale, 1);
 #endif
 }

@@ -298,7 +299,7 @@
        new_entry.extra = *extra;
        new_entry.preg_options = poptions;
 #if HAVE_SETLOCALE
-       new_entry.locale = locale;
+       new_entry.locale = pestrdup(locale, 1);
        new_entry.tables = tables;
 #endif
        zend_hash_update(&PCRE_G(pcre_cache), regex, regex_len+1, 
(void *)&new_entry,

--------------------


Lee, David Y. wrote:

> I tried applying the patch to 4.2.3 source and got:
> 
> [root@oakland php-4.2.3]# patch -p0 < patch
> patching file `ext/pcre/php_pcre.c'
> Hunk #1 FAILED at 64.
> Hunk #2 FAILED at 299.
> 2 out of 2 hunks FAILED -- saving rejects to ext/pcre/php_pcre.c.rej
> 
> What am I missing here? (excuse my stupiditiy pls)
> 
> Thanks!
> 
> -----Original Message-----
> From: speedfreak50@netscape.net [mailto:speedfreak50@netscape.net]
> Sent: Monday, October 07, 2002 12:11 PM
> To: imp@lists.horde.org
> Subject: [imp] Apache segfault FIXED!
> 
> 
> The PHP guys have posted a fix for the segfault related to the pcre 
code. 
> Here's a patch relative to php-4.2.3.  I'm still testing this on a
> Redhat/Apache/PHP box (7.3/1.3.26/4.2.3) box and so far it looks 
good.
> 
> A great big THANK YOU to the PHP guys and Amith for fixing this!!!
> 
> ---------------------
> Patch relative to 4.2.3 - use patch -p0 < [patch] from php source 
dir
> ---------------------
> diff -ru ext/pcre/php_pcre.c ext/pcre.new/php_pcre.c
> --- ext/pcre/php_pcre.c Thu Feb 28 03:26:35 2002
> +++ ext/pcre.new/php_pcre.c     Mon Oct  7 14:27:37 2002
> @@ -64,6 +64,7 @@
>         pefree(pce->re, 1);
>  #if HAVE_SETLOCALE
>         if ((void*)pce->tables) pefree((void*)pce->tables, 1);
> +       pefree(pce->locale, 1);
>  #endif
>  }
> 
> @@ -298,7 +299,7 @@
>         new_entry.extra = *extra;
>         new_entry.preg_options = poptions;
>  #if HAVE_SETLOCALE
> -       new_entry.locale = locale;
> +       new_entry.locale = pestrdup(locale, 1);
>         new_entry.tables = tables;
>  #endif
>         zend_hash_update(&PCRE_G(pcre_cache), regex, regex_len+1, 
(void
>         *)&new_entry,
> 
> 
> __________________________________________________________________
> The NEW Netscape 7.0 browser is now available. Upgrade now!
> http://channels.netscape.com/ns/browsers/download.jsp
> 
> Get your own FREE, personal Netscape Mail account today at
> http://webmail.netscape.com/
> 



More information about the imp mailing list