Bug appears to be in the input from a socket in recv()