CopernicaMarketingSoftware / PHP-CPP

Library to build PHP extensions with C++
http://www.php-cpp.com/
Apache License 2.0
1.42k stars 333 forks source link

Segfault comparing nonstring value to string: Php::Value(123) == "abcd" #524

Closed ebikt closed 5 months ago

ebikt commented 5 months ago
Php::Value x(123);
x == "123"; // segfault, because ::strcmp(NULL, "123") is invoked

Php::Value::rawValue() is used in PHP-CPP code in places, where proper conversion to string should be done, that leads to errorneous behaviour (typically segfaults) when non-string value is passed from PHP and is not type checked in extension based on PHP-CPP. This type checking is job of PHP-CPP in my opinion.