mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-30 04:29:01 +01:00
fix #34. forget to initialize zval
This commit is contained in:
parent
105841efb6
commit
0a7cb9757c
3
php_uv.c
3
php_uv.c
@ -1717,6 +1717,9 @@ static void php_uv_fs_cb(uv_fs_t* req)
|
||||
zval *buffer;
|
||||
if (req && req->ptr) {
|
||||
buffer = php_uv_make_stat((const uv_statbuf_t*)req->ptr);
|
||||
} else {
|
||||
MAKE_STD_ZVAL(buffer);
|
||||
ZVAL_NULL(buffer);
|
||||
}
|
||||
params[1] = &buffer;
|
||||
break;
|
||||
|
17
tests/399-fs-stat-regression-no14.phpt
Normal file
17
tests/399-fs-stat-regression-no14.phpt
Normal file
@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Check for #14
|
||||
--FILE--
|
||||
<?php
|
||||
$loop = uv_default_loop();
|
||||
$filename ="does_not_exist.txt";
|
||||
uv_fs_stat($loop, $filename, function ($result, $stat) {
|
||||
echo $result . PHP_EOL;
|
||||
if (is_null($stat)) {
|
||||
echo "NULL" . PHP_EOL;
|
||||
}
|
||||
});
|
||||
uv_run();
|
||||
|
||||
--EXPECT--
|
||||
-1
|
||||
NULL
|
Loading…
Reference in New Issue
Block a user