mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 04:48:00 +03:00
fix rub to crash gracefully upon decoding invalid data
if we exceed the number of available bits, crash.
This commit is contained in:
parent
092cb9cd49
commit
7e80f0dfda
@ -1743,7 +1743,12 @@
|
||||
~/ %rub
|
||||
|= [a=@ b=@]
|
||||
^- [p=@ q=@]
|
||||
=+ c==+(c=0 |-(?.(=(0 (cut 0 [(add a c) 1] b)) c $(c +(c)))))
|
||||
=+ ^= c
|
||||
=+ [c=0 m=(met 0 b)]
|
||||
|- ?< (gth c m)
|
||||
?. =(0 (cut 0 [(add a c) 1] b))
|
||||
c
|
||||
$(c +(c))
|
||||
?: =(0 c)
|
||||
[1 0]
|
||||
=+ d=(add a +(c))
|
||||
|
Loading…
Reference in New Issue
Block a user