r/programming • • 6d ago

Ruby2Shell

https://verialabs.com/ruby2shell/
184 Upvotes

44 comments sorted by

View all comments

Show parent comment

2

u/fakehalo 5d ago

Its confusing, because looking at the code snippet itself it appears like the while(to<to_len) check iterating through each character would still only allow this the be a single byte overflowing the very last iteration.. since the *to++ is happening/incrementing 2 times each loop to keep the check (except for the very last one)