r/programming • • 11d ago

Ruby2Shell

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

45 comments sorted by

View all comments

Show parent comment

2

u/fakehalo 10d 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)