summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2016-02-13 19:34:20 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2016-02-14 08:32:35 -0500
commit99b234bca42d2b5f9f5f74960bfd693b6d9c0b27 (patch)
treeae602fc3e8317d68cf0a42cc410369e7c4c28411 /sv.c
parent907196b2ca1c36611c32cb89c75e791391979005 (diff)
downloadperl-99b234bca42d2b5f9f5f74960bfd693b6d9c0b27.tar.gz
Skip the length sanity check if d_name is pointer or less.
[perl #127511] v5.23.7-308-g1d41bb7 broke t/op/threads-dirh.t on solaris threaded builds In other words, skip it if the dirent->d_name is a pointer (char *) or less (struct-final char d_name[1], as it seems to be in Solaris). The length sanity check is meant for places where the d_name is a true array. Follow-up to 1d41bb72.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index c214c996c1..819a250ee3 100644
--- a/sv.c
+++ b/sv.c
@@ -13108,7 +13108,7 @@ Perl_dirp_dup(pTHX_ DIR *const dp, CLONE_PARAMS *const param)
pos = PerlDir_tell(dp);
if ((dirent = PerlDir_read(dp))) {
len = d_namlen(dirent);
- if (len > sizeof(dirent->d_name)) {
+ if (len > sizeof(dirent->d_name) && sizeof(dirent->d_name) > PTRSIZE) {
/* If the len is somehow magically longer than the
* maximum length of the directory entry, even though
* we could fit it in a buffer, we could not copy it