Decompiling main and set_mouse_name shows us where the vulnerability is and how we can exploit it.
main:
set_mouse_name:
We can see variable size is set to 10. We can change it to high value with one byte overflow through function set_mouse_name. We send mouse name with following payload:
This is will set size to 0xff.
Now we can send long payload since the app is trying to read 0xff bytes instead of 10.
We overwrite return address with address of function cheeeeeeeese and get a shell.