summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2018-12-12 14:38:09 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-10-01 19:19:56 +0900
commita0a2640b398cffd351f87d3f6243103add66575b (patch)
treea8dc849fe08b67a7a54f081c2654ce2812ad42e4 /dir.c
parenta38fe1fbf068d05177e6e6fac2b8ec7704873e63 (diff)
Fix for wrong fnmatch patttern
* dir.c (file_s_fnmatch): ensure that pattern does not contain a NUL character. https://hackerone.com/reports/449617
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 6d1f501..d20cf60 100644
--- a/dir.c
+++ b/dir.c
@@ -3211,7 +3211,7 @@ file_s_fnmatch(int argc, VALUE *argv, VALUE obj)
else
flags = 0;
- StringValue(pattern);
+ StringValueCStr(pattern);
FilePathStringValue(path);
if (flags & FNM_EXTGLOB) {