iliaa           Thu Feb 23 18:28:37 2006 UTC

  Modified files:              
    /php-src/ext/standard       streamsfuncs.c 
  Log:
  MFB51: Fixed bug #35900 (stream_select() should warning when tv_sec is 
  negative).
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.63&r2=1.64&diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.63 
php-src/ext/standard/streamsfuncs.c:1.64
--- php-src/ext/standard/streamsfuncs.c:1.63    Tue Feb 21 20:12:42 2006
+++ php-src/ext/standard/streamsfuncs.c Thu Feb 23 18:28:37 2006
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: streamsfuncs.c,v 1.63 2006/02/21 20:12:42 dmitry Exp $ */
+/* $Id: streamsfuncs.c,v 1.64 2006/02/23 18:28:37 iliaa Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -763,6 +763,14 @@
        if (sec != NULL) {
                convert_to_long(sec);
 
+               if (sec < 0) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "The 
seconds parameter must be greater then 0.");
+                       RETURN_FALSE;
+               } else if (usec < 0) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "The 
microseconds parameter must be greater then 0.");
+                       RETURN_FALSE;
+               }
+
                /* Solaris + BSD do not like microsecond values which are >= 1 
sec */
                if (usec > 999999) {
                        tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000);

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

Reply via email to