Re: [PATCH php v2] Fix crash in VIRT_HASH_CURRENT_KEY_INFO macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/06/2017 05:54 PM, Dawid Zamirski wrote:
> The PHP7 variant of the macro wasn't safe if the hash key was not a
> string type. This was found when running php script with just
> libvirt_connect call under xdebug session which segfaulted. This patch
> makes the following changes:
> 
> * make sure that tmp_name is initialized to NULL
> * set the key name only when zend_hash_get_current_key_ex did set it to
>   something which happens only when type is HASH_KEY_IS_STRING
> * stash the key index in out php_libvirt_hash_key_info struct because it
>   wasn't there before and separate variable had to be used.
> ---
> 
> v1: https://www.redhat.com/archives/libvir-list/2017-December/msg00151.html
> 
> Changes since v1:
>  * use zend_ulong in php_libvirt_hash_key_info struct so that no type
>    cast is needed
> 
>  src/libvirt-connection.c |  8 +++-----
>  src/libvirt-php.c        |  6 ++----
>  src/libvirt-php.h        |  1 +
>  src/util.h               | 16 +++++++++-------
>  4 files changed, 15 insertions(+), 16 deletions(-)

ACKed and pushed.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux