Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jan 2008 17:48:57 +0100 (CET)
From:      Martin Matuska <mm@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/120088: [PATCH] lang/php5 databases/php5-pgsql
Message-ID:  <20080128164857.050D73989B@mail.vx.sk>
Resent-Message-ID: <200801281650.m0SGo3Sf048666@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         120088
>Category:       ports
>Synopsis:       [PATCH] lang/php5 databases/php5-pgsql
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 28 16:50:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Martin Matuska
>Release:        FreeBSD 7.0-RC1 i386 and amd64
>Organization:
>Environment:
System: FreeBSD 7.0-RC1 i386 and amd64
>Description:
This patch fixes PHP pgsql bugs #43525 and #43526
http://bugs.php.net/bug.php?id=43525
http://bugs.php.net/bug.php?id=43526

Patch author: mi+php@aldan.algebra.com (= mi@FreeBSD.org)
Apply patch with -p flag (-p0)

>How-To-Repeat:
>Fix:
Index: ports/lang/php5/Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/php5/Makefile,v
retrieving revision 1.123
diff -u -r1.123 Makefile
--- ports/lang/php5/Makefile	15 Jan 2008 07:38:45 -0000	1.123
+++ ports/lang/php5/Makefile	28 Jan 2008 16:34:37 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	php5
 PORTVERSION=	5.2.5
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES?=	lang devel www
 MASTER_SITES=	${MASTER_SITE_PHP}
 MASTER_SITE_SUBDIR=	distributions
Index: ports/lang/php5/files/patch-Zend-zend_list.h
===================================================================
RCS file: ports/lang/php5/files/patch-Zend-zend_list.h
diff -N ports/lang/php5/files/patch-Zend-zend_list.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/lang/php5/files/patch-Zend-zend_list.h	28 Jan 2008 16:34:37 -0000
@@ -0,0 +1,50 @@
+--- Zend/zend_list.h	Mon Jan  1 04:35:46 2007
++++ Zend/zend_list.h	Thu Dec  6 22:52:34 2007
+@@ -72,7 +72,7 @@
+ 
+ ZEND_API int zend_list_insert(void *ptr, int type);
+-ZEND_API int _zend_list_addref(int id TSRMLS_DC);
+-ZEND_API int _zend_list_delete(int id TSRMLS_DC);
+-ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC);
++ZEND_API int _zend_list_addref(ulong id TSRMLS_DC);
++ZEND_API int _zend_list_delete(ulong id TSRMLS_DC);
++ZEND_API void *_zend_list_find(ulong id, int *type TSRMLS_DC);
+ 
+ #define zend_list_addref(id)		_zend_list_addref(id TSRMLS_CC)
+@@ -83,5 +83,5 @@
+ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
+ 
+-ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC);
++ZEND_API char *zend_rsrc_list_get_rsrc_type(ulong resource TSRMLS_DC);
+ ZEND_API int zend_fetch_list_dtor_id(char *type_name);
+ 
+--- Zend/zend_list.c	Mon Jan  1 04:35:46 2007
++++ Zend/zend_list.c	Thu Dec  6 22:58:18 2007
+@@ -49,5 +49,5 @@
+ }
+ 
+-ZEND_API int _zend_list_delete(int id TSRMLS_DC)
++ZEND_API int _zend_list_delete(ulong id TSRMLS_DC)
+ {
+ 	zend_rsrc_list_entry *le;
+@@ -66,5 +66,5 @@
+ 
+ 
+-ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC)
++ZEND_API void *_zend_list_find(ulong id, int *type TSRMLS_DC)
+ {
+ 	zend_rsrc_list_entry *le;
+@@ -79,5 +79,5 @@
+ }
+ 
+-ZEND_API int _zend_list_addref(int id TSRMLS_DC)
++ZEND_API int _zend_list_addref(ulong id TSRMLS_DC)
+ {
+ 	zend_rsrc_list_entry *le;
+@@ -351,5 +351,5 @@
+ 
+ 
+-char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC)
++char *zend_rsrc_list_get_rsrc_type(ulong resource TSRMLS_DC)
+ {
+ 	zend_rsrc_list_dtors_entry *lde;
Index: ports/databases/php5-pgsql/files/patch-pgsql.c
===================================================================
RCS file: ports/databases/php5-pgsql/files/patch-pgsql.c
diff -N ports/databases/php5-pgsql/files/patch-pgsql.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/databases/php5-pgsql/files/patch-pgsql.c	28 Jan 2008 16:34:37 -0000
@@ -0,0 +1,82 @@
+--- pgsql.c	Wed Oct  3 19:31:58 2007
++++ pgsql.c	Thu Dec  6 23:16:34 2007
+@@ -63,4 +63,5 @@
+ #define PGSQL_MAX_LENGTH_OF_DOUBLE 60
+ 
++#if UINT_MAX > LONG_MAX
+ #define PGSQL_RETURN_OID(oid) do { \
+ 	if (oid > LONG_MAX) { \
+@@ -72,5 +73,7 @@
+ 	RETURN_LONG((long)oid); \
+ } while(0)
+-
++#else
++#define PGSQL_RETURN_OID(oid) RETURN_LONG((long)oid)
++#endif
+ 
+ #if HAVE_PQSETNONBLOCKING
+@@ -273,5 +276,5 @@
+ 
+ /* {{{ _php_pgsql_trim_message */
+-static char * _php_pgsql_trim_message(const char *message, int *len)
++static char * _php_pgsql_trim_message(const char *message, size_t *len)
+ {
+ 	register int i = strlen(message)-1;
+@@ -364,5 +367,5 @@
+ 			php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice->message);
+ 		}
+-		zend_hash_index_update(&PGG(notices), (int)resource_id, (void **)&notice, sizeof(php_pgsql_notice *), NULL);
++		zend_hash_index_update(&PGG(notices), (ulong)resource_id, (void **)&notice, sizeof(php_pgsql_notice *), NULL);
+ 	}
+ }
+@@ -762,5 +765,6 @@
+ 		if (!(connect_type & PGSQL_CONNECT_FORCE_NEW)
+ 			&& zend_hash_find(&EG(regular_list),str.c,str.len+1,(void **) &index_ptr)==SUCCESS) {
+-			int type,link;
++			int type;
++			ulong link;
+ 			void *ptr;
+ 
+@@ -768,5 +772,5 @@
+ 				RETURN_FALSE;
+ 			}
+-			link = (int) index_ptr->ptr;
++			link = (uintptr_t /* ulong is as wide or wider than pointer */) index_ptr->ptr;
+ 			ptr = zend_list_find(link,&type);   /* check if the link is still there */
+ 			if (ptr && (type==le_link || type==le_plink)) {
+@@ -1749,4 +1753,5 @@
+ 
+ 	if (return_oid) {
++#if UINT_MAX > LONG_MAX /* Oid is unsigned int, we don't need this code, where LONG is wider */
+ 		if (oid > LONG_MAX) {
+ 			smart_str oidstr = {0};
+@@ -1754,5 +1759,7 @@
+ 			smart_str_0(&oidstr);
+ 			RETURN_STRINGL(oidstr.c, oidstr.len, 0);
+-		} else {
++		} else
++#endif
++		{
+ 			RETURN_LONG((long)oid);
+ 		}
+@@ -1855,4 +1862,5 @@
+ 			oid = PQftype(pgsql_result, Z_LVAL_PP(field));
+ 
++#if UINT_MAX > LONG_MAX
+ 			if (oid > LONG_MAX) {
+ 				smart_str s = {0};
+@@ -1864,4 +1872,5 @@
+ 			}
+ 			else
++#endif
+ 			{
+ 				Z_LVAL_P(return_value) = (long)oid;
+@@ -5742,6 +5751,6 @@
+ 	zval *row;
+ 	char *field_name, *element, *data;
+-	size_t num_fields, element_len, data_len;
+-	int pg_numrows, pg_row;
++	size_t num_fields, element_len;
++	int pg_numrows, pg_row, data_len;
+ 	uint i;
+ 	assert(Z_TYPE_P(ret_array) == IS_ARRAY);
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080128164857.050D73989B>