Bug #62475 [NEW]: variant_* functions causes crash when null given as an argument

From: Date: Tue, 03 Jul 2012 20:56:12 +0000
Subject: Bug #62475 [NEW]: variant_* functions causes crash when null given as an argument
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-171726@lists.php.net to get a copy of this message
From:             deadb17ch at gmail dot com
Operating system: Windows XP SP3
PHP version:      5.4.4
Package:          COM related
Bug Type:         Bug
Bug description:variant_* functions causes crash when null given as an argument

Description:
------------
As we can read in the php manual : 

"As with all the variant arithmetic functions, the parameters for this
function 
can be either a PHP native type (integer, string, floating point, boolean
or 
NULL), or an instance of a COM, VARIANT or DOTNET class. ...."

but actuall php instance crashes when we give NULL as first or second
argument 
to some of the functions from variant_* familly.

Thoes functions are: 

variant_neg
variant_pow
variant_cat
variant_div
variant_fix
variant_idiv
variant_imp
variant_int
variant_mod
variant_mul
variant_neg
variant_not
variant_rount
variant_set
variant_sub
variant_xor
variant_or 
variant_eqv 
variant_cmp 
variant_abs 
variant_and

Test script:
---------------
<?php variant_pow(null, 1); ?>

<?php variant_neg(null); ?>


Expected result:
----------------
nothing happens or an error occurs

Actual result:
--------------
crash

eax=00000000 ebx=01250080 ecx=00c0fac8 edx=1039bac6 esi=00000000
edi=00c0fac8
eip=100f4036 esp=00c0fa90 ebp=02296f08 iopl=0         nv up ei pl zr na pe
nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000            
efl=00200246
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for

C:\\xampp\\php\\php5ts.dll - 
php5ts!php_com_variant_from_zval+0x6:
100f4036 0fb6460c        movzx   eax,byte ptr [esi+0Ch]    
ds:0023:0000000c=??

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62475&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=62475&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=62475&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=62475&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=62475&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62475&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=62475&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=62475&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=62475&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=62475&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=62475&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=62475&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=62475&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=62475&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=62475&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=62475&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=62475&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=62475&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=62475&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=62475&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=62475&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=62475&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#171726) next »