1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 02:02:32 +01:00

- Enforce stream mode correct

This commit is contained in:
Marcus Boerger
2006-05-14 01:03:42 +00:00
parent 73069100fd
commit f9c249407d

View File

@@ -656,6 +656,13 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, cha
/* 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);