Using version 4.3.3
It appears that when the connect packet data provided to this function exceeds 256 bytes, the function continues to memcpy the data without checking if the pointer p has gone past the end of the buffer b. This is causing a stack smash upon returning from the function.