helly           Sun May 14 01:03:42 2006 UTC

  Modified files:              
    /php-src/main/streams       memory.c 
  Log:
  - Enforce stream mode correct
  
http://cvs.php.net/viewcvs.cgi/php-src/main/streams/memory.c?r1=1.17&r2=1.18&diff_format=u
Index: php-src/main/streams/memory.c
diff -u php-src/main/streams/memory.c:1.17 php-src/main/streams/memory.c:1.18
--- php-src/main/streams/memory.c:1.17  Sun May 14 00:45:27 2006
+++ php-src/main/streams/memory.c       Sun May 14 01:03:42 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: memory.c,v 1.17 2006/05/14 00:45:27 helly Exp $ */
+/* $Id: memory.c,v 1.18 2006/05/14 01:03:42 helly Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -656,6 +656,13 @@
                /* store data */
                php_stream_temp_write(stream, comma, dlen TSRMLS_CC);
                php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs TSRMLS_CC);
+               /* set special stream stuff (enforce exact mode) */
+               vlen = strlen(mode);
+               if (vlen >= sizeof(stream->mode)) {
+                       vlen = sizeof(stream->mode) - 1;
+               }
+               memcpy(stream->mode, mode, vlen);
+               stream->mode[vlen] = '\0';
                stream->ops = &php_stream_rfc2397_ops;
                ts = (php_stream_temp_data*)stream->abstract;
                assert(ts != NULL);

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

Reply via email to