diff options
author | Eric Wong <e@80x24.org> | 2015-01-09 01:47:18 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-01-09 02:08:08 +0000 |
commit | a818db828b3cdaae04376a64bc6800a770b0c4cb (patch) | |
tree | 26d300a02be52d990285574baa335214be777113 | |
parent | df570e817dbb8afc42efd05521b29d836fe11736 (diff) | |
download | kgio-a818db828b3cdaae04376a64bc6800a770b0c4cb.tar.gz |
Calling rb_intern(RSTRING_PTR(err)) was unsafe as the `err' value could be GC-ed inside rb_intern. This only affected Ruby 1.8 as Errno.constants returns an array of Symbols under 1.9+ Thanks to Petr Novodvorskiy for reporting the issue. ref: <CAHGF7iJk9-wK5WbSiAgQaRye7y2RJttLBpykRBpnKkxFi=ASHg@mail.gmail.com> Cc: Petr Novodvorskiy <nidd@skytap.com> Cc: Lara Martin <lmartin@skytap.com> Cc: Nick Astete <nastete@skytap.com>
-rw-r--r-- | ext/kgio/tryopen.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/kgio/tryopen.c b/ext/kgio/tryopen.c index 20f3f6d..d87cb17 100644 --- a/ext/kgio/tryopen.c +++ b/ext/kgio/tryopen.c @@ -194,4 +194,5 @@ void init_kgio_tryopen(void) ID2SYM(const_id)); } } + RB_GC_GUARD(tmp); } |