PHP  
 PHP_7_2
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for ext/ldap/tests/ldap_exop.phpt ('ldap_exop() and ldap_parse_exop() - EXOP operations')

Script

1: <?php
2:
require "connect.inc";
3:
4:
$link ldap_connect_and_bind($host$port$user$passwd$protocol_version);
5:
insert_dummy_data($link$base);
6:
7: function 
build_reqdata_passwd($user$oldpw$newpw)
8: {
9:     
// This is basic and will only work for small strings
10:     
$hex '';
11:     if (!empty(
$user)) {
12:         
$hex .= '80'.sprintf("%'.02x"strlen($user)).bin2hex($user);
13:     }
14:     if (!empty(
$oldpw)) {
15:         
$hex .= '81'.sprintf("%'.02x"strlen($oldpw)).bin2hex($oldpw);
16:     }
17:     if (!empty(
$newpw)) {
18:         
$hex .= '82'.sprintf("%'.02x"strlen($newpw)).bin2hex($newpw);
19:     }
20:     return 
hex2bin('30'.sprintf("%'.02x"strlen($hex)/2).$hex);
21: }
22:
23: function 
extract_genpw($retdata)
24: {
25:     
// Only works for small strings as well
26:     
return hex2bin(substr(bin2hex($retdata), 4*2));
27: }
28:
29:
$userAPassword "oops";
30:
31:
// ldap_exop(resource link, string reqoid [, string reqdata [, array servercontrols [, string &retdata [, string &retoid]]]])
32: // bool ldap_parse_exop(resource link, resource result [, string &retdata [, string &retoid]])
33:
var_dump(
34:     
ldap_exop($linkLDAP_EXOP_WHO_AM_INULLNULL$retdata$retoid),
35:     
$retdata,
36:     
$retoid,
37:     
$r ldap_exop($linkLDAP_EXOP_WHO_AM_I),
38:     
ldap_parse_exop($link$r$retdata2),
39:     
$retdata2,
40:     
test_bind($host$port"cn=userA,$base"$userAPassword$protocol_version),
41:     
$r ldap_exop($linkLDAP_EXOP_MODIFY_PASSWDbuild_reqdata_passwd("cn=userA,$base"$userAPassword"")),
42:     
ldap_parse_exop($link$r$retpwdata$retpwoid),
43:     
$genpw extract_genpw($retpwdata),
44:     
$retpwoid,
45:     
test_bind($host$port"cn=userA,$base"$genpw$protocol_version)
46: );
47:
?>
48:
===DONE===
49:

Report

==24824== Conditional jump or move depends on uninitialised value(s)
==24824==    at 0x988725: zif_ldap_exop (ldap.c:3399)
==24824==    by 0x11C0812: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:617)
==24824==    by 0x133C718: execute_ex (zend_vm_execute.h:59726)
==24824==    by 0x133CD90: zend_execute (zend_vm_execute.h:63763)
==24824==    by 0x10E180E: zend_execute_scripts (zend.c:1496)
==24824==    by 0xFD3164: php_execute_script (main.c:2590)
==24824==    by 0x134292D: do_cli (php_cli.c:1011)
==24824==    by 0x13442E1: main (php_cli.c:1404)
==24824== 

 

Generated at Sat, 09 Dec 2017 10:21:20 +0000 (2 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.