The GSS specificationa actually specifies that strings are not necessarily null-terminated. Change the code to comply with this fact.