prevent mangling the input string

git-svn-id: file:///home/svn/framework3/trunk@11148 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Joshua Drake 2010-11-25 07:42:34 +00:00
parent 4c26dfbfd8
commit ee7d5827d5
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ module RFB
class Cipher
def self.mangle_password(password)
key = password || ''
key = ''
key = password.dup if password
key.slice!(8,key.length) if key.length > 8
key << "\x00" * (8 - key.length) if key.length < 8