diff options
author | Nobuyoshi Nakada <[email protected]> | 2019-08-04 22:19:18 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2019-08-04 22:21:53 +0900 |
commit | 76e2370f132f83c16c9de39a0a9356579f364527 (patch) | |
tree | 2793ca82836ed8dc3d421144fdb0ddcaf962b85f /load.c | |
parent | 346aa557b31fe96760e505d30da26eb7a846bac9 (diff) |
Fix dangling path name from fstring
* load.c (rb_require_internal): make sure in advance that the path
to be loaded shares a fstring, to get rid of dangling path name.
Fixed up 5931857281ce45c1c277aa86d1588119ab00a955. [Bug #16041]
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1015,7 +1015,7 @@ rb_require_internal(VALUE fname, int safe) RUBY_DTRACE_HOOK(FIND_REQUIRE_RETURN, RSTRING_PTR(fname)); if (found) { - if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) { + if (!path || !(path = rb_fstring(path), ftptr = load_lock(RSTRING_PTR(path)))) { result = 0; } else if (!*ftptr) { |