~ubuntu-branches/ubuntu/gutsy/php5/gutsy

« back to all changes in this revision

Viewing changes to ext/zip/tests/oo_stream.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, CVE-2007-0905, CVE-2007-0906, CVE-2007-0909, CVE-2007-0910
  • Date: 2007-02-20 17:54:46 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070220175446-nudqyuv0dfowel3r
Tags: 5.2.1-0ubuntu1
* New upstream security/bugfix release:
  - safe_mode & open_basedir bypasses inside the session extension
    [CVE-2007-0905]
  - multiple buffer overflows in various extensions and functions
    [CVE-2007-0906]
  - underflow in the internal sapi_header_op() function [CVE-2007-0907]
  - information disclosure in the wddx extension [CVE-2007-0908]
  - string format vulnerability in *print() functions on 64 bit systems
    [CVE-2007-0909]
  - possible clobbering of super-globals in several code paths
    [CVE-2007-0910]
* Adapted patches to new upstream release:
  - 006-debian_quirks.patch
  - 034-apache2_umask_fix.patch
  - 044-strtod_arm_fix.patch
* Drop 109-libdb4.4.patch: Obsolete, upstream now checks for db 4.5 and 4.4.
* Drop 114-zend_alloc.c_m68k_alignment.patch and
  115-zend_alloc.c_memleak.patch: Applied upstream.
* Add debian/patches/000upstream-str_ireplace_offbyone.patch:
  - Fix off-by-one in str_ireplace(), a regression introduced in 5.2.1.
  - Patch taken from upstream CVS:
    http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.630&r2=1.631
  - CVE-2007-0911
* debian/control: Set Ubuntu maintainer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
getStream
 
3
--SKIPIF--
 
4
<?php
 
5
/* $Id: oo_stream.phpt,v 1.2.2.2 2006/11/03 16:46:19 pajoye Exp $ */
 
6
if(!extension_loaded('zip')) die('skip');
 
7
?>
 
8
--FILE--
 
9
<?php
 
10
$dirname = dirname(__FILE__) . '/';
 
11
$file = $dirname . 'test_with_comment.zip';
 
12
include $dirname . 'utils.inc';
 
13
$zip = new ZipArchive;
 
14
if (!$zip->open($file)) {
 
15
        exit('failed');
 
16
}
 
17
$fp = $zip->getStream('foo');
 
18
 
 
19
var_dump($fp);
 
20
if(!$fp) exit("\n");
 
21
$contents = '';
 
22
while (!feof($fp)) {
 
23
        $contents .= fread($fp, 255);
 
24
}
 
25
 
 
26
fclose($fp);
 
27
$zip->close();
 
28
var_dump($contents);
 
29
 
 
30
 
 
31
$fp = fopen('zip://' . dirname(__FILE__) . '/test_with_comment.zip#foo', 'rb');
 
32
if (!$fp) {
 
33
  exit("cannot open\n");
 
34
}
 
35
$contents = '';
 
36
while (!feof($fp)) {
 
37
  $contents .= fread($fp, 2);
 
38
}
 
39
var_dump($contents);
 
40
fclose($fp);
 
41
 
 
42
?>
 
43
--EXPECTF--
 
44
resource(%d) of type (stream)
 
45
string(5) "foo
 
46
 
 
47
"
 
48
string(5) "foo
 
49
 
 
50
"