Timeout and overflow of arduino

What everyone else said. Don't use the C++ String class, use c-strings ('\0' terminated arrays of char).