--- cvsnt-2.5.03.2382/protocols/ntlm/smbutil.c.orig 2006-10-21 03:30:43.000000000 +0200 +++ cvsnt-2.5.03.2382/protocols/ntlm/smbutil.c 2006-10-21 03:50:05.000000000 +0200 @@ -258,6 +258,12 @@ buildSmbNtlmAuthRequest_userlen (tSmbNtl /* FIXME this should be workstation, not username */ AddBytes (request, user, user, user_len); AddString (request, domain, domain); + /* offset must not point past end of message (otherwise server responds + * with "The parameter is incorrect."), however if the string length + * is zero it doesn't matter where exactly the offset points to, I think + */ + if (!domain || !*domain) + request->domain.offset--; } void