From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Feb 20 20:50:15 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20EC616A84B for ; Tue, 20 Feb 2007 20:50:15 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id F314613C467 for ; Tue, 20 Feb 2007 20:50:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l1KKoEfW085546 for ; Tue, 20 Feb 2007 20:50:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l1KKoELW085545; Tue, 20 Feb 2007 20:50:14 GMT (envelope-from gnats) Resent-Date: Tue, 20 Feb 2007 20:50:14 GMT Resent-Message-Id: <200702202050.l1KKoELW085545@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alexander Zhuravlev Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5FDBC16A84B; Tue, 20 Feb 2007 20:47:16 +0000 (UTC) (envelope-from zaa@ulstu.ru) Received: from kernel.ulstu.ru (kernel.ulstu.ru [62.76.34.36]) by mx1.freebsd.org (Postfix) with ESMTP id B3BEB13C442; Tue, 20 Feb 2007 20:47:00 +0000 (UTC) (envelope-from zaa@ulstu.ru) Received: from localhost (localhost [127.0.0.1]) by kernel.ulstu.ru (ulstuMail) with ESMTP id 3344B4AF82; Tue, 20 Feb 2007 23:12:28 +0300 (MSK) Received: from kernel.ulstu.ru ([127.0.0.1]) by localhost (kernel.ulstu.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CTEzcp6MNtmd; Tue, 20 Feb 2007 23:12:21 +0300 (MSK) Received: from orion.ulstu.ru (orion.ulstu.ru [62.76.34.33]) by kernel.ulstu.ru (ulstuMail) with ESMTP id EA56C4AEEF; Tue, 20 Feb 2007 23:12:20 +0300 (MSK) Received: by orion.ulstu.ru (Postfix, from userid 3909) id 137AF1B47; Tue, 20 Feb 2007 23:12:21 +0300 (MSK) Message-Id: <20070220201221.137AF1B47@orion.ulstu.ru> Date: Tue, 20 Feb 2007 23:12:21 +0300 (MSK) From: Alexander Zhuravlev To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: ale@FreeBSD.org Subject: ports/109372: [PATCH] for www/php4-session which fixes php 4.4.5 segfault when register_globals=on X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alexander Zhuravlev List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Feb 2007 20:50:15 -0000 >Number: 109372 >Category: ports >Synopsis: [PATCH] for www/php4-session which fixes php 4.4.5 segfault when register_globals=on >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Feb 20 20:50:14 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Alexander Zhuravlev >Release: FreeBSD 4.11-STABLE i386 >Organization: >Environment: System: FreeBSD orion.ulstu.ru 4.11-STABLE FreeBSD 4.11-STABLE #30: Tue Dec 12 15:18:35 MSK 2006 root@orion.ulstu.ru:/usr/obj/usr/src/sys/ORION i386 >Description: The patch fixes php bug #40505. PHP 4.4.5 has a bug in sessions handling which leads to segfaults when register_globals option is enabled. Attached patch bumps php4-session revision and applies the patch. >How-To-Repeat: >Fix: --- php4-session.patch begins here --- diff -urbBN php4-session.orig/Makefile php4-session/Makefile --- php4-session.orig/Makefile Mon Jul 19 12:41:18 2004 +++ php4-session/Makefile Tue Feb 20 22:48:41 2007 @@ -5,6 +5,8 @@ # $FreeBSD: ports/www/php4-session/Makefile,v 1.1 2004/07/19 08:41:18 ale Exp $ # +PORTREVISION=1 + CATEGORIES= www MASTERDIR= ${.CURDIR}/../../lang/php4 diff -urbBN php4-session.orig/files/patch-session_segfault.diff php4-session/files/patch-session_segfault.diff --- php4-session.orig/files/patch-session_segfault.diff Thu Jan 1 03:00:00 1970 +++ php4-session/files/patch-session_segfault.diff Tue Feb 20 22:37:03 2007 @@ -0,0 +1,43 @@ +Index: ext/session/session.c +--- session.c 2007/01/09 15:31:36 1.336.2.53.2.13 ++++ session.c 2007/02/15 09:41:30 1.336.2.53.2.14 +@@ -17,7 +17,7 @@ + +----------------------------------------------------------------------+ + */ + +-/* $Id: session.c,v 1.336.2.53.2.13 2007/01/09 15:31:36 iliaa Exp $ */ ++/* $Id: session.c,v 1.336.2.53.2.14 2007/02/15 09:41:30 tony2001 Exp $ */ + + #ifdef HAVE_CONFIG_H + #include "config.h" +@@ -271,8 +271,12 @@ + { + zval **sym_track = NULL; + +- zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1, +- (void *) &sym_track); ++ IF_SESSION_VARS() { ++ zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1, ++ (void *) &sym_track); ++ } else { ++ return; ++ } + + /* + * Set up a proper reference between $_SESSION["x"] and $x. +@@ -281,11 +285,10 @@ + if (PG(register_globals)) { + zval **sym_global = NULL; + +- zend_hash_find(&EG(symbol_table), name, namelen + 1, +- (void *) &sym_global); +- +- if ((Z_TYPE_PP(sym_global) == IS_ARRAY && Z_ARRVAL_PP(sym_global) == &EG(symbol_table)) || *sym_global == PS(http_session_vars)) { +- return; ++ if (zend_hash_find(&EG(symbol_table), name, namelen + 1, (void *) &sym_global) == SUCCESS) { ++ if ((Z_TYPE_PP(sym_global) == IS_ARRAY && Z_ARRVAL_PP(sym_global) == &EG(symbol_table)) || *sym_global == PS(http_session_vars)) { ++ return; ++ } + } + + if (sym_global == NULL && sym_track == NULL) { --- php4-session.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: