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

« back to all changes in this revision

Viewing changes to ext/oci8/tests/bug40078.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
Bug #40078 (ORA-01405 when fetching NULL values using oci_bind_array_by_name())
 
3
--SKIPIF--
 
4
<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
 
5
--FILE--
 
6
<?php
 
7
 
 
8
require dirname(__FILE__).'/connect.inc';
 
9
 
 
10
$create_pkg = "
 
11
CREATE OR REPLACE PACKAGE ARRAYBINDPKG1 AS
 
12
    TYPE ARRTYPE IS TABLE OF VARCHAR(20) INDEX BY BINARY_INTEGER;
 
13
    PROCEDURE nullbind(c1 OUT ARRTYPE);
 
14
END ARRAYBINDPKG1;";
 
15
$statement = oci_parse($c, $create_pkg);
 
16
oci_execute($statement);
 
17
 
 
18
$create_pkg_body = "
 
19
CREATE OR REPLACE PACKAGE BODY ARRAYBINDPKG1 AS
 
20
    PROCEDURE nullbind(c1 OUT ARRTYPE) IS
 
21
    BEGIN
 
22
        c1(1) := 'one';
 
23
        c1(2) := 'two';
 
24
        c1(3) := '';
 
25
        c1(4) := 'four';
 
26
        c1(5) := 'five';
 
27
    END nullbind;
 
28
END ARRAYBINDPKG1;";
 
29
$statement = oci_parse($c, $create_pkg_body);
 
30
oci_execute($statement);
 
31
 
 
32
$statement = oci_parse($c, "BEGIN ARRAYBINDPKG1.nullbind(:c1); END;");
 
33
 
 
34
oci_bind_array_by_name($statement, ":c1", $array, 5, 20, SQLT_CHR);
 
35
 
 
36
oci_execute($statement);
 
37
 
 
38
var_dump($array);
 
39
 
 
40
echo "Done\n";
 
41
?>
 
42
--EXPECTF--     
 
43
array(5) {
 
44
  [0]=>
 
45
  string(3) "one"
 
46
  [1]=>
 
47
  string(3) "two"
 
48
  [2]=>
 
49
  string(0) ""
 
50
  [3]=>
 
51
  string(4) "four"
 
52
  [4]=>
 
53
  string(4) "five"
 
54
}
 
55
Done