It's not one byte. It's one byte per ß. The writeup says the buffer is allocated as len + 20, so you need 21 ßs to overflow 1 byte. Make that "ß*100<payload>", and you've pushed your payload 80 bytes past the buffer.
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)
View all comments
Show parent comment
11
u/coriandor 4d ago
It's not one byte. It's one byte per ß. The writeup says the buffer is allocated as len + 20, so you need 21 ßs to overflow 1 byte. Make that "ß*100<payload>", and you've pushed your payload 80 bytes past the buffer.