Handle NULL strings gracefully during constant registration
authorMichael Heimpold <mhei@heimpold.de>
Sun, 4 Jun 2017 13:00:33 +0000 (15:00 +0200)
committerMichael Wallner <mike@php.net>
Mon, 3 Jul 2017 07:56:30 +0000 (09:56 +0200)
commit9f7e758f5dbd70ce624ddaa00ac6c383ac151c2b
treeb26c0afc45b6e0137d4e7a6c059a40593c5deeba
parentd5d88f419c63a98f7cdef991e63f37b17f9ae413
Handle NULL strings gracefully during constant registration

When libcurl is compiled not using e.g. libz or SSL, then a call to
curl_version_info could return NULL in the corresponding fields of
curl_version_info_data.

Passing such NULL pointers down to REGISTER_NS_STRING_CONSTANT results
in a segfault during php startup, so let's check for this special case
and register a NULL constant in this case.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
src/php_http_client_curl.c