summaryrefslogtreecommitdiff
path: root/win32/readdir.h
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-11-15 09:55:29 +0100
committerAnatol Belski <ab@php.net>2017-11-15 09:55:29 +0100
commit020fdfd55dc534eecab12a53bb3ef50d7a71e5cb (patch)
tree2c2becc773981ee55d014c0a7c993d44c2bf37f4 /win32/readdir.h
parent235d33ac7a28cd6d33043f1753fa999c81410303 (diff)
downloadphp-git-020fdfd55dc534eecab12a53bb3ef50d7a71e5cb.tar.gz
Fixed bug #75525 Access Violation in vcruntime140.dll
It was a mistake to make d_name a pointer. d_name has to be allocated in the body of struct dirent as per POSIX.1-2008. The binary compatibility is kept through the extra padding, which will be removed in 7.3.
Diffstat (limited to 'win32/readdir.h')
-rw-r--r--win32/readdir.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/win32/readdir.h b/win32/readdir.h
index 0ed7b1d640..5c594fd7ea 100644
--- a/win32/readdir.h
+++ b/win32/readdir.h
@@ -22,7 +22,11 @@ struct dirent {
long d_ino; /* inode (always 1 in WIN32) */
off_t d_off; /* offset to this dirent */
unsigned short d_reclen; /* length of d_name */
- char *d_name; /* null terminated filename in the current encoding, glyph number <= 255 wchar_t's + \0 byte */
+ unsigned short pad0;
+#if defined(_WIN64)
+ uint32_t pad1;
+#endif
+ char d_name[1]; /* null terminated filename in the current encoding, glyph number <= 255 wchar_t's + \0 byte */
};
/* typedef DIR - not the same as Unix */