php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76741 oci_bind_by_name memory allocation issue
Submitted: 2018-08-14 09:58 UTC Modified: 2018-11-18 22:33 UTC
From: dmitry dot matora at gmail dot com Assigned: sixd (profile)
Status: No Feedback Package: OCI8 related
PHP Version: 7.0.31 OS: Debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dmitry dot matora at gmail dot com
New email:
PHP Version: OS:

 

 [2018-08-14 09:58 UTC] dmitry dot matora at gmail dot com
Description:
------------
looks like oci_bind_by_name has some memory allocation issue

when clave == '';
running oci_bind_by_name($stid, ":password", strtoupper($clave))
produces 'Only variables should be passed by reference' which is expected, but then all empty strings are string(6) "\x00\x00\x00\x00\x00\x00" instead of string(0) ""
substr("", 0, 0) still produces string(0) "" though


Test script:
---------------
$clave = '';
oci_bind_by_name($stid, ":password", strtoupper($clave))
$test = ''; var_dump($test);
will produce string(6) "\x00\x00\x00\x00\x00\x00";

Expected result:
----------------
I expect 
$test = ''; var_dump($test);
to produce string(0) ""

Actual result:
--------------
after reaching clave=""; oci_bind_by_name($stid, ":password", strtoupper($clave))

$test = ''; var_dump($test);
produces string(6) "\x00\x00\x00\x00\x00\x00"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-19 17:25 UTC] bukka@php.net
-Package: FPM related +Package: OCI8 related
 [2018-08-19 17:25 UTC] bukka@php.net
it doesn't seem to be fpm related...
 [2018-08-20 03:48 UTC] sixd@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: sixd
 [2018-08-20 03:48 UTC] sixd@php.net
Can you give a runnable testcase and any CREATE TABLE and INSERT statements required?
 [2018-11-18 22:33 UTC] cmb@php.net
-Status: Feedback +Status: No Feedback
 [2018-11-18 22:33 UTC] cmb@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 08 01:03:35 2021 UTC