* [ruby-dev:50267] [Ruby trunk Bug#13953] gdbm が SHARABLE_MIDDLE_SUBSTRING=1 を考慮していない
[not found] <redmine.issue-13953.20170930043726@ruby-lang.org>
@ 2017-09-30 4:37 ` tommy
2017-12-24 20:06 ` [ruby-dev:50385] " nagachika00
2018-01-31 13:39 ` [ruby-dev:50456] " usa
2 siblings, 0 replies; 3+ messages in thread
From: tommy @ 2017-09-30 4:37 UTC (permalink / raw
To: ruby-dev
Issue #13953 has been reported by tommy (Masahiro Tomita).
----------------------------------------
Bug #13953: gdbm が SHARABLE_MIDDLE_SUBSTRING=1 を考慮していない
https://bugs.ruby-lang.org/issues/13953
* Author: tommy (Masahiro Tomita)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.5.0dev (2017-09-29 trunk 60062) [x86_64-linux]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
SHARABLE_MIDDLE_SUBSTRING=1 でコンパイルしたRubyで、GDBM.new が指定した文字列ではなく共有元の文字列終端までファイル名として使用してしまいます。
~~~
% ruby -rgdbm -e 'GDBM.new(("0123456789"*10)[0,24])'
% ls
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
~~~
次のパッチで直ると思います。
~~~ diff
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 709f466cd8..cbf96c29f9 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -228,7 +228,7 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
if (!NIL_P(vflags))
flags = NUM2INT(vflags);
- SafeStringValue(file);
+ FilePathValue(file);
#ifdef GDBM_CLOEXEC
/* GDBM_CLOEXEC is available since gdbm 1.10. */
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [ruby-dev:50385] [Ruby trunk Bug#13953] gdbm が SHARABLE_MIDDLE_SUBSTRING=1 を考慮していない
[not found] <redmine.issue-13953.20170930043726@ruby-lang.org>
2017-09-30 4:37 ` [ruby-dev:50267] [Ruby trunk Bug#13953] gdbm が SHARABLE_MIDDLE_SUBSTRING=1 を考慮していない tommy
@ 2017-12-24 20:06 ` nagachika00
2018-01-31 13:39 ` [ruby-dev:50456] " usa
2 siblings, 0 replies; 3+ messages in thread
From: nagachika00 @ 2017-12-24 20:06 UTC (permalink / raw
To: ruby-dev
Issue #13953 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 2.3: REQUIRED, 2.4: REQUIRED to 2.3: REQUIRED, 2.4: DONE
ruby_2_4 r61456 merged revision(s) 60071.
----------------------------------------
Bug #13953: gdbm が SHARABLE_MIDDLE_SUBSTRING=1 を考慮していない
https://bugs.ruby-lang.org/issues/13953#change-68628
* Author: tommy (Masahiro Tomita)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.5.0dev (2017-09-29 trunk 60062) [x86_64-linux]
* Backport: 2.3: REQUIRED, 2.4: DONE
----------------------------------------
SHARABLE_MIDDLE_SUBSTRING=1 でコンパイルしたRubyで、GDBM.new が指定した文字列ではなく共有元の文字列終端までファイル名として使用してしまいます。
~~~
% ruby -rgdbm -e 'GDBM.new(("0123456789"*10)[0,24])'
% ls
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
~~~
次のパッチで直ると思います。
~~~ diff
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 709f466cd8..cbf96c29f9 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -228,7 +228,7 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
if (!NIL_P(vflags))
flags = NUM2INT(vflags);
- SafeStringValue(file);
+ FilePathValue(file);
#ifdef GDBM_CLOEXEC
/* GDBM_CLOEXEC is available since gdbm 1.10. */
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [ruby-dev:50456] [Ruby trunk Bug#13953] gdbm が SHARABLE_MIDDLE_SUBSTRING=1 を考慮していない
[not found] <redmine.issue-13953.20170930043726@ruby-lang.org>
2017-09-30 4:37 ` [ruby-dev:50267] [Ruby trunk Bug#13953] gdbm が SHARABLE_MIDDLE_SUBSTRING=1 を考慮していない tommy
2017-12-24 20:06 ` [ruby-dev:50385] " nagachika00
@ 2018-01-31 13:39 ` usa
2 siblings, 0 replies; 3+ messages in thread
From: usa @ 2018-01-31 13:39 UTC (permalink / raw
To: ruby-dev
Issue #13953 has been updated by usa (Usaku NAKAMURA).
Backport changed from 2.3: REQUIRED, 2.4: DONE to 2.3: DONE, 2.4: DONE
ruby_2_3 r62140 merged revision(s) 60071.
----------------------------------------
Bug #13953: gdbm が SHARABLE_MIDDLE_SUBSTRING=1 を考慮していない
https://bugs.ruby-lang.org/issues/13953#change-70085
* Author: tommy (Masahiro Tomita)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.5.0dev (2017-09-29 trunk 60062) [x86_64-linux]
* Backport: 2.3: DONE, 2.4: DONE
----------------------------------------
SHARABLE_MIDDLE_SUBSTRING=1 でコンパイルしたRubyで、GDBM.new が指定した文字列ではなく共有元の文字列終端までファイル名として使用してしまいます。
~~~
% ruby -rgdbm -e 'GDBM.new(("0123456789"*10)[0,24])'
% ls
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
~~~
次のパッチで直ると思います。
~~~ diff
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 709f466cd8..cbf96c29f9 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -228,7 +228,7 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
if (!NIL_P(vflags))
flags = NUM2INT(vflags);
- SafeStringValue(file);
+ FilePathValue(file);
#ifdef GDBM_CLOEXEC
/* GDBM_CLOEXEC is available since gdbm 1.10. */
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-31 13:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <redmine.issue-13953.20170930043726@ruby-lang.org>
2017-09-30 4:37 ` [ruby-dev:50267] [Ruby trunk Bug#13953] gdbm が SHARABLE_MIDDLE_SUBSTRING=1 を考慮していない tommy
2017-12-24 20:06 ` [ruby-dev:50385] " nagachika00
2018-01-31 13:39 ` [ruby-dev:50456] " usa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).