Data response from server isn't zero terminated is it?

Fix for a crash that I am getting on Yosemite.

It seems like the code was assuming that the returned string was zero terminated, and I don't think it is...