Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard array.c assert.c basic_functions.c browscap.c crypt.c file.c filestat.c head.c html.c http.c info.c mail.c math.c proc_open.c rand.c streamsfuncs.c st

2008-10-22 Thread Nuno Lopes

Hey, hey, what are you doing?
I assume you're reading the 
http://gcov.php.net/viewer.php?version=PHP_5_3func=params page. That script 
is very dumb and unfortunately shows many false positives. I did a cursory 
review of your commits and most of the changes you did aren't necessary (in 
fact they can degrade the performance).
This year I was hoping to get a student from the GSoC project to improve 
this analyzer, but I didn't. Let's hope next year we can get one :P (if 
someone is interested please contact me!)


In the mean time, please don't assume that script is 100% right. Please 
always look to the code first to check if the initialization is really 
needed.


Thanks,
Nuno

- Original Message - 
From: Arnaud Le Blanc [EMAIL PROTECTED]

To: php-cvs@lists.php.net
Sent: Tuesday, October 21, 2008 11:08 PM
Subject: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard array.c assert.c 
basic_functions.c browscap.c crypt.c file.c filestat.c head.c html.c http.c 
info.c mail.c math.c proc_open.c rand.c streamsfuncs.c string.c type.c 
versioning.c




lbarnaud Tue Oct 21 22:08:39 2008 UTC

 Modified files:  (Branch: PHP_5_3)
   /php-src/ext/standard array.c assert.c basic_functions.c browscap.c
crypt.c file.c filestat.c head.c html.c
http.c info.c mail.c math.c proc_open.c
rand.c streamsfuncs.c string.c type.c
versioning.c
 Log:
 MFH: initialize optional vars 



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo/libmagic apprentice.c

2008-10-22 Thread Scott MacVicar
scottmacWed Oct 22 14:15:47 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/fileinfo/libmagic  apprentice.c 
  Log:
  MFH: When using the internal database and there is an error it could try free 
some invalid things. This was causing a bus error on ppc.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/apprentice.c?r1=1.7.2.9r2=1.7.2.10diff_format=u
Index: php-src/ext/fileinfo/libmagic/apprentice.c
diff -u php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.9 
php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.10
--- php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.9  Mon Oct 20 23:36:14 2008
+++ php-src/ext/fileinfo/libmagic/apprentice.c  Wed Oct 22 14:15:47 2008
@@ -1842,6 +1842,9 @@
 
 /*
  * handle a compiled file.
+ * return -1 = error
+ * return 1  = memory structure you can free
+ * return 3  = bundled library from PHP
  */
 private int
 apprentice_map(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
@@ -1853,7 +1856,7 @@
char *dbname = NULL;
void *mm = NULL;
int   ret = 0;
-   php_stream *stream;
+   php_stream *stream = NULL;
php_stream_statbuf st;
 
 
@@ -1908,12 +1911,15 @@
goto error1;
}
needsbyteswap = 1;
-   } else
+   } else {
needsbyteswap = 0;
+   }
+
if (needsbyteswap)
version = swap4(ptr[1]);
else
version = ptr[1];
+
if (version != VERSIONNO) {
file_error(ms, 0, File %d.%d supports only %d version magic 
files. `%s' is version %d, FILE_VERSION_MAJOR, patchlevel,
@@ -1953,14 +1959,17 @@
if (stream) {
php_stream_close(stream);
}
-   if (mm) {
+
+   if (mm  ret == 1) {
efree(mm);
} else {
*magicp = NULL;
*nmagicp = 0;
}
 error2:
-   efree(dbname);
+   if (dbname) {
+   efree(dbname);
+   }
return -1;
 }
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/fileinfo/libmagic apprentice.c

2008-10-22 Thread Scott MacVicar
scottmacWed Oct 22 16:34:17 2008 UTC

  Modified files:  
/php-src/ext/fileinfo/libmagic  apprentice.c 
  Log:
  Fix a stat on a null when the internal database is used.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/apprentice.c?r1=1.15r2=1.16diff_format=u
Index: php-src/ext/fileinfo/libmagic/apprentice.c
diff -u php-src/ext/fileinfo/libmagic/apprentice.c:1.15 
php-src/ext/fileinfo/libmagic/apprentice.c:1.16
--- php-src/ext/fileinfo/libmagic/apprentice.c:1.15 Wed Oct 22 13:59:08 2008
+++ php-src/ext/fileinfo/libmagic/apprentice.c  Wed Oct 22 16:34:17 2008
@@ -251,9 +251,12 @@
}
 
if ((rv = apprentice_map(ms, magic, nmagic, fn)) == -1) {
-   if (ms-flags  MAGIC_CHECK)
-   file_magwarn(ms, using regular magic file `%s', fn);
-   rv = apprentice_load(ms, magic, nmagic, fn, action);
+   if (fn) {
+   if (ms-flags  MAGIC_CHECK)
+   file_magwarn(ms, using regular magic file 
`%s', fn);
+   rv = apprentice_load(ms, magic, nmagic, fn, action);
+   }
+
if (rv != 0)
return -1;
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/fileinfo/libmagic apprentice.c

2008-10-22 Thread Scott MacVicar
scottmacWed Oct 22 16:34:40 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/fileinfo/libmagic  apprentice.c 
  Log:
  MFH: Fix a stat on a null when the internal database is used.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/apprentice.c?r1=1.7.2.10r2=1.7.2.11diff_format=u
Index: php-src/ext/fileinfo/libmagic/apprentice.c
diff -u php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.10 
php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.11
--- php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.10 Wed Oct 22 14:15:47 2008
+++ php-src/ext/fileinfo/libmagic/apprentice.c  Wed Oct 22 16:34:40 2008
@@ -257,9 +257,12 @@
}
 
if ((rv = apprentice_map(ms, magic, nmagic, fn)) == -1) {
-   if (ms-flags  MAGIC_CHECK)
-   file_magwarn(ms, using regular magic file `%s', fn);
-   rv = apprentice_load(ms, magic, nmagic, fn, action);
+   if (fn) {
+   if (ms-flags  MAGIC_CHECK)
+   file_magwarn(ms, using regular magic file 
`%s', fn);
+   rv = apprentice_load(ms, magic, nmagic, fn, action);
+   }
+
if (rv != 0)
return -1;
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/sockets sockets.c

2008-10-22 Thread Arnaud Le Blanc
lbarnaudWed Oct 22 18:58:43 2008 UTC

  Modified files:  
/php-src/ext/socketssockets.c 
  Log:
  Fixed bug #46360 (TCP_NODELAY constant for socket_{get,set}_option)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.201r2=1.202diff_format=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.201 php-src/ext/sockets/sockets.c:1.202
--- php-src/ext/sockets/sockets.c:1.201 Tue Oct 21 23:36:17 2008
+++ php-src/ext/sockets/sockets.c   Wed Oct 22 18:58:43 2008
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.201 2008/10/21 23:36:17 lbarnaud Exp $ */
+/* $Id: sockets.c,v 1.202 2008/10/22 18:58:43 lbarnaud Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -661,6 +661,9 @@
REGISTER_LONG_CONSTANT(SO_ERROR,  SO_ERROR,   
CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SOL_SOCKET,SOL_SOCKET, 
CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SOMAXCONN, SOMAXCONN,  
CONST_CS | CONST_PERSISTENT);
+#ifdef TCP_NODELAY
+   REGISTER_LONG_CONSTANT(TCP_NODELAY,   TCP_NODELAY,CONST_CS | 
CONST_PERSISTENT);
+#endif
REGISTER_LONG_CONSTANT(PHP_NORMAL_READ, PHP_NORMAL_READ, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(PHP_BINARY_READ, PHP_BINARY_READ, CONST_CS | 
CONST_PERSISTENT);
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/sockets sockets.c

2008-10-22 Thread Arnaud Le Blanc
lbarnaudWed Oct 22 18:59:34 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
/php-src/ext/socketssockets.c 
  Log:
  MFH: Fixed bug #46360 (TCP_NODELAY constant for socket_{get,set}_option)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.349r2=1.2027.2.547.2.965.2.350diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.349 
php-src/NEWS:1.2027.2.547.2.965.2.350
--- php-src/NEWS:1.2027.2.547.2.965.2.349   Tue Oct 21 23:22:00 2008
+++ php-src/NEWSWed Oct 22 18:59:33 2008
@@ -18,6 +18,8 @@
 
 - Fixed bug causing the algorithm parameter of mhash() to be modified. (Scott)
 
+- Fixed bug #46360 (TCP_NODELAY constant for socket_{get,set}_option). 
+  (bugs at trick dot vanstaveren dot us)
 - Fixed bug #46238 (Segmentation fault on static call with empty string 
method).
   (Felipe)
 - Fixed bug #46205 (Closure - Memory leaks when ReflectionException is thrown).
http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.7r2=1.171.2.9.2.14.2.8diff_format=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.7 
php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.8
--- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.7Tue Oct 21 23:39:15 2008
+++ php-src/ext/sockets/sockets.c   Wed Oct 22 18:59:33 2008
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.171.2.9.2.14.2.7 2008/10/21 23:39:15 lbarnaud Exp $ */
+/* $Id: sockets.c,v 1.171.2.9.2.14.2.8 2008/10/22 18:59:33 lbarnaud Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -661,6 +661,9 @@
REGISTER_LONG_CONSTANT(SO_ERROR,  SO_ERROR,   
CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SOL_SOCKET,SOL_SOCKET, 
CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SOMAXCONN, SOMAXCONN,  
CONST_CS | CONST_PERSISTENT);
+#ifdef TCP_NODELAY
+   REGISTER_LONG_CONSTANT(TCP_NODELAY,   TCP_NODELAY,CONST_CS | 
CONST_PERSISTENT);
+#endif
REGISTER_LONG_CONSTANT(PHP_NORMAL_READ, PHP_NORMAL_READ, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(PHP_BINARY_READ, PHP_BINARY_READ, CONST_CS | 
CONST_PERSISTENT);
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: CVSROOT / avail

2008-10-22 Thread Pierre-Alain Joye
pajoye  Wed Oct 22 19:08:25 2008 UTC

  Modified files:  
/CVSROOTavail 
  Log:
  - mabouzou karma for pecl/sqlanywhere
  
  
http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1458r2=1.1459diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1458 CVSROOT/avail:1.1459
--- CVSROOT/avail:1.1458Mon Oct 20 15:18:04 2008
+++ CVSROOT/avail   Wed Oct 22 19:08:24 2008
@@ -210,7 +210,6 @@
 avail|dmcfarli|pecl/staf
 avail|areaz2|pecl/dazuko
 avail|nicos|php-src/ext/readline
-avail|mabouzou|php-src/ext/sqlanywhere
 avail|aditus|jpgraph
 avail|phallstrom|php-gtk-web/apps,php-gtk-web/include/apps.inc
 avail|tal,momo|php-src/ext/calendar
@@ -298,6 +297,7 @@
 avail|iodbc|php-src/ext/odbc,php-src/NEWS
 avail|ross|phpdoc,gd
 avail|ab|pecl/ktaglib
+avail|mabouzou|pecl/sqlanywhere
 
 # Objective-C bridge
 avail|wez,jan|php-objc



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/pdo_oci config.m4

2008-10-22 Thread Stanislav Malyshev
stasWed Oct 22 19:29:48 2008 UTC

  Modified files:  
/php-src/ext/pdo_ociconfig.m4 
  Log:
  fix instantclient detection
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/config.m4?r1=1.27r2=1.28diff_format=u
Index: php-src/ext/pdo_oci/config.m4
diff -u php-src/ext/pdo_oci/config.m4:1.27 php-src/ext/pdo_oci/config.m4:1.28
--- php-src/ext/pdo_oci/config.m4:1.27  Fri Oct 10 20:05:31 2008
+++ php-src/ext/pdo_oci/config.m4   Wed Oct 22 19:29:48 2008
@@ -1,19 +1,17 @@
-dnl $Id: config.m4,v 1.27 2008/10/10 20:05:31 stas Exp $
+dnl $Id: config.m4,v 1.28 2008/10/22 19:29:48 stas Exp $
 dnl config.m4 for extension pdo_oci
 dnl vim:et:sw=2:ts=2:
 
-SUPPORTED_VERS=9 10 11
+SUPPORTED_LIB_VERS=9.0 10.1 11.1  # This caters for all Oracle 9.x, 10.x and 
11.1 installs
 AC_DEFUN([AC_PDO_OCI_VERSION],[
   AC_MSG_CHECKING([Oracle version])
-  for OCI_VER in $SUPPORTED_VERS; do
-  if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER.*; 
then
-PDO_OCI_VERSION=$OCI_VER.x
-  fi
+  for OCI_VER in $SUPPORTED_LIB_VERS; do
+if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER; then
+  PDO_OCI_VERSION=$OCI_VER
+fi
   done
-  if test -z $PDO_OCI_VERSION ;then
-{ { echo $as_me:$LINENO: error: Oracle-OCI needed libraries not found 
under $PDO_OCI_DIR 5
-echo $as_me: error: Oracle-OCI needed libraries not found under 
$PDO_OCI_DIR 2;}
-   { (exit 1); exit 1; }; }
+  if test -z $PDO_OCI_VERSION; then
+AC_MSG_ERROR([Oracle required OCI8 libraries not found under $PDO_OCI_DIR])
   fi
   AC_MSG_RESULT($PDO_OCI_VERSION)
 ]) 

   
@@ -37,7 +35,7 @@
   elif test -d $PDO_OCI_DIR/lib  test -d $PDO_OCI_DIR/lib32; then
 PDO_OCI_LIB_DIR=$TMP_PDO_OCI_LIB_DIR
   else
-AC_MSG_ERROR([Oracle (OCI8) required libraries not found])
+AC_MSG_ERROR([Oracle required OCI8 libraries not found])
   fi
   AC_MSG_RESULT($PDO_OCI_LIB_DIR)
 ])
@@ -134,12 +132,12 @@
   fi
 
   case $PDO_OCI_VERSION in
-9.x|10.x|11.x)
+9.0|10.1|10.2|11.1)
   PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
   ;;
 
 *)
-  AC_MSG_ERROR(Unsupported Oracle version! $PDO_OCI_VERSION)
+  AC_MSG_ERROR(Unsupported Oracle version $PDO_OCI_VERSION)
   ;;
   esac
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/pdo_oci config.m4

2008-10-22 Thread Stanislav Malyshev
stasWed Oct 22 19:29:24 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/pdo_ociconfig.m4 
  Log:
  fix instantclient detection
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/config.m4?r1=1.14.2.5.2.6.2.4r2=1.14.2.5.2.6.2.5diff_format=u
Index: php-src/ext/pdo_oci/config.m4
diff -u php-src/ext/pdo_oci/config.m4:1.14.2.5.2.6.2.4 
php-src/ext/pdo_oci/config.m4:1.14.2.5.2.6.2.5
--- php-src/ext/pdo_oci/config.m4:1.14.2.5.2.6.2.4  Fri Oct 10 20:05:05 2008
+++ php-src/ext/pdo_oci/config.m4   Wed Oct 22 19:29:24 2008
@@ -1,19 +1,17 @@
-dnl $Id: config.m4,v 1.14.2.5.2.6.2.4 2008/10/10 20:05:05 stas Exp $
+dnl $Id: config.m4,v 1.14.2.5.2.6.2.5 2008/10/22 19:29:24 stas Exp $
 dnl config.m4 for extension pdo_oci
 dnl vim:et:sw=2:ts=2:
 
-SUPPORTED_VERS=9 10 11
+SUPPORTED_LIB_VERS=9.0 10.1 11.1  # This caters for all Oracle 9.x, 10.x and 
11.1 installs
 AC_DEFUN([AC_PDO_OCI_VERSION],[
   AC_MSG_CHECKING([Oracle version])
-  for OCI_VER in $SUPPORTED_VERS; do
-  if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER.*; 
then
-PDO_OCI_VERSION=$OCI_VER.x
-  fi
+  for OCI_VER in $SUPPORTED_LIB_VERS; do
+if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER; then
+  PDO_OCI_VERSION=$OCI_VER
+fi
   done
-  if test -z $PDO_OCI_VERSION ;then
-{ { echo $as_me:$LINENO: error: Oracle-OCI needed libraries not found 
under $PDO_OCI_DIR 5
-echo $as_me: error: Oracle-OCI needed libraries not found under 
$PDO_OCI_DIR 2;}
-   { (exit 1); exit 1; }; }
+  if test -z $PDO_OCI_VERSION; then
+AC_MSG_ERROR([Oracle required OCI8 libraries not found under $PDO_OCI_DIR])
   fi
   AC_MSG_RESULT($PDO_OCI_VERSION)
 ]) 

   
@@ -37,7 +35,7 @@
   elif test -d $PDO_OCI_DIR/lib  test -d $PDO_OCI_DIR/lib32; then
 PDO_OCI_LIB_DIR=$TMP_PDO_OCI_LIB_DIR
   else
-AC_MSG_ERROR([Oracle (OCI8) required libraries not found])
+AC_MSG_ERROR([Oracle required OCI8 libraries not found])
   fi
   AC_MSG_RESULT($PDO_OCI_LIB_DIR)
 ])
@@ -134,12 +132,12 @@
   fi
 
   case $PDO_OCI_VERSION in
-9.x|10.x|11.x)
+9.0|10.1|10.2|11.1)
   PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
   ;;
 
 *)
-  AC_MSG_ERROR(Unsupported Oracle version! $PDO_OCI_VERSION)
+  AC_MSG_ERROR(Unsupported Oracle version $PDO_OCI_VERSION)
   ;;
   esac
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS

2008-10-22 Thread Ilia Alshanetsky
iliaa   Wed Oct 22 23:29:24 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
  Log:
  
  MFB: revert define() fix for now
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1269r2=1.2027.2.547.2.1270diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1269 php-src/NEWS:1.2027.2.547.2.1270
--- php-src/NEWS:1.2027.2.547.2.1269Tue Oct 21 16:43:59 2008
+++ php-src/NEWSWed Oct 22 23:29:23 2008
@@ -2,8 +2,6 @@
 |||
 ?? Oct 2008, PHP 5.2.7RC2
 - Fixed bug #46343 (IPv6 address filter accepts invalid address). (Ilia)
-- Fixed bug #46341 (Added missing validation checks into define() for class
-  constants). (Ilia)
 - Fixed bug #46335 (DOMText::splitText doesn't handle multibyte characters).
   (Rob)
 - Fixed bug #46323 (compilation of simplexml for NetWare breaks). 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php