strncpy() causes reset

If reply is 308 bytes and reply2 is 309 bytes, that's 617 bytes of RAM for one operation.

Could you be running out of memory?