summaryrefslogtreecommitdiff
path: root/transcode.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-17 07:23:03 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-17 07:23:03 +0000
commit7766666aed80c7e06dfd8288302a663638b66fe5 (patch)
treecc987648ae9dc0c49e4099c89f251044ecc40aa3 /transcode.c
parentb2bb02940199c3a540e903e9bb5b31abbf26f4aa (diff)
merge revision(s) 51037: [Backport #11277]
* transcode.c (load_transcoder_entry): fix transcoder loading race condition, by waiting in require. [ruby-dev:49106] [Bug #11277] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@51598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
-rw-r--r--transcode.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/transcode.c b/transcode.c
index 0182a205c2..1cb5631bce 100644
--- a/transcode.c
+++ b/transcode.c
@@ -372,15 +372,12 @@ load_transcoder_entry(transcoder_entry_t *entry)
char *const path = RSTRING_PTR(fn);
const int safe = rb_safe_level();
- entry->lib = NULL;
-
memcpy(path, transcoder_lib_prefix, sizeof(transcoder_lib_prefix) - 1);
memcpy(path + sizeof(transcoder_lib_prefix) - 1, lib, len);
rb_str_set_len(fn, total_len);
FL_UNSET(fn, FL_TAINT);
OBJ_FREEZE(fn);
- if (!rb_require_safe(fn, safe > 3 ? 3 : safe))
- return NULL;
+ rb_require_safe(fn, safe > 3 ? 3 : safe);
}
if (entry->transcoder)