]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
fix idlib.could_be_base32_encoded_l() to accept *only* valid strings
authorZooko O'Whielacronx <zooko@zooko.com>
Thu, 3 Jan 2008 18:43:11 +0000 (11:43 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Thu, 3 Jan 2008 18:43:11 +0000 (11:43 -0700)
src/allmydata/util/idlib.py

index a972b22e751822239a2d70a4a048826ce0e72e5c..8432f5801d3e3cf3224d645c7e8d67c8a3486385 100644 (file)
@@ -161,9 +161,9 @@ s8 = init_s8()
 # string tells whether the final character is reasonable.
 def init_s5():
     s5 = []
-    add_check_array(chars, s5)
-    for lenmod5 in (1, 2, 3, 4,):
-        add_check_array(get_trailing_chars_without_lsbs(4-lenmod5), s5)
+    add_check_array(get_trailing_chars_without_lsbs(0), s5)
+    for lenmod5 in [1,2,3,4]:
+        add_check_array(get_trailing_chars_without_lsbs(5-lenmod5), s5)
     return tuple(s5)
 s5 = init_s5()