Count of field bytes must begin at 0. Otherwise the decoder truncates
1 byte from the string due to lstring initial state values.
Also drop the lstring_zero(s) macro. It is only used in one place and
calling it 'zero' obscures that length is non-zero for invalid state.
return NTLM_ERR_NONE;
}
-#define lstring_zero(s) s.str=NULL; s.l=-1;
-
/**
* Fetches a string from the authentication packet.
* The lstring data-part may point to inside the packet itself or a temporary static buffer.
lstring rv;
char *d;
- lstring_zero(rv);
+ rv.str = NULL;
+ rv.l = -1;
l = le16toh(str->len);
o = le32toh(str->offset);
return rv;
}
rv.str = (char *)packet + o;
+ rv.l = 0;
if ((flags & NTLM_NEGOTIATE_ASCII) == 0) {
/* UNICODE string */
unsigned short *s = (unsigned short *)rv.str;