cvs: php-src /main/streams memory.c
| From: | Marcus Boerger | Date: | Sun, 14 May 2006 01:03:42 +0000 |
| Subject: | cvs: php-src /main/streams memory.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-38199@lists.php.net to get a copy of this message | ||
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);