diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-14 16:01:45 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-14 16:01:45 +0000 |
| commit | 15d27690475aaa461a8302bdf3fc5901e7b5710d (patch) | |
| tree | f5a47d2772beea7e30bd43117c33df7832c41f14 /ext/gdbm | |
| parent | 7e75205af725a2f2151b5cb4bfcc78531fb1c9bc (diff) | |
| download | ruby-15d27690475aaa461a8302bdf3fc5901e7b5710d.tar.gz ruby-15d27690475aaa461a8302bdf3fc5901e7b5710d.tar.xz ruby-15d27690475aaa461a8302bdf3fc5901e7b5710d.zip | |
* ext/gdbm/gdbm.c (fgdbm_store): StringValue() may alter string
pointer. [ruby-dev:24783]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/gdbm')
| -rw-r--r-- | ext/gdbm/gdbm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c index 799445a89..ac208efbe 100644 --- a/ext/gdbm/gdbm.c +++ b/ext/gdbm/gdbm.c @@ -598,10 +598,11 @@ fgdbm_store(obj, keystr, valstr) rb_gdbm_modify(obj); StringValue(keystr); + StringValue(valstr); + key.dptr = RSTRING(keystr)->ptr; key.dsize = RSTRING(keystr)->len; - StringValue(valstr); val.dptr = RSTRING(valstr)->ptr; val.dsize = RSTRING(valstr)->len; |
