mirror of
https://github.com/php/php-src.git
synced 2026-04-27 10:16:41 +02:00
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Prevent fd leak in readdir_r that causes false negative on readdir_r implementation when compiled with AddressSanitizer
This commit is contained in:
+4
-1
@@ -1376,8 +1376,11 @@ main() {
|
||||
dir = opendir("/");
|
||||
if (!dir)
|
||||
exit(1);
|
||||
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0)
|
||||
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) {
|
||||
close(dir);
|
||||
exit(0);
|
||||
}
|
||||
close(dir);
|
||||
exit(1);
|
||||
}
|
||||
],[
|
||||
|
||||
Reference in New Issue
Block a user