]> granicus.if.org Git - php/commitdiff
check if the winver was indeed fetched
authorAnatol Belski <ab@php.net>
Sat, 13 Sep 2014 18:42:46 +0000 (20:42 +0200)
committerAnatol Belski <ab@php.net>
Sat, 13 Sep 2014 21:21:48 +0000 (23:21 +0200)
ext/standard/info.c

index a1a44cbae64fa0e29b4e0ea9ae02abdbca2826b0..67944b350e385100cb94cbd7fc4ec1ded638eecf 100644 (file)
@@ -585,6 +585,12 @@ PHPAPI zend_string *php_get_uname(char mode)
                char *winver = php_get_windows_name();
                char wincpu[20];
 
+               if (NULL == winver) {
+                       TSRMLS_FETCH();
+                       /* This should never happen */
+                       return STR_EMPTY_ALLOC();
+               }
+
                php_get_windows_cpu(wincpu, sizeof(wincpu));
                dwBuild = (DWORD)(HIWORD(dwVersion));