mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bignum.c (bigdivrem): access boundary bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ba9003a0a3
commit
eeb7234919
6 changed files with 25 additions and 10 deletions
|
@ -96,10 +96,19 @@ class CGI
|
|||
end
|
||||
|
||||
class FileStore
|
||||
def check_id(id)
|
||||
/[^0-9a-zA-Z]/ =~ id.to_s ? false : true
|
||||
end
|
||||
module_function :check_id
|
||||
|
||||
def initialize(session, option={})
|
||||
dir = option['tmpdir'] || ENV['TMP'] || '/tmp'
|
||||
prefix = option['prefix'] || ''
|
||||
path = dir+"/"+prefix+session.session_id
|
||||
id = session.session_id
|
||||
unless check_id(id)
|
||||
raise ArgumentError, "session_id `%s' is invalid" % id
|
||||
end
|
||||
path = dir+"/"+prefix+id
|
||||
path.untaint
|
||||
unless File::exist? path
|
||||
@hash = {}
|
||||
|
@ -149,9 +158,9 @@ class CGI
|
|||
class MemoryStore
|
||||
GLOBAL_HASH_TABLE = {}
|
||||
|
||||
def initialize(session, option={})
|
||||
def initialize(session, option=nil)
|
||||
@session_id = session.session_id
|
||||
GLOBAL_HASH_TABLE[@session_id] = {}
|
||||
GLOBAL_HASH_TABLE[@session_id] ||= {}
|
||||
end
|
||||
|
||||
def restore
|
||||
|
@ -167,7 +176,7 @@ class CGI
|
|||
end
|
||||
|
||||
def delete
|
||||
GLOBAL_HASH_TABLE[@session_id] = nil
|
||||
GLOBAL_HASH_TABLE.delete(@session_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue