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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
30 + 3 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC