diff options
Diffstat (limited to 'daemon/ntlm.c')
-rw-r--r-- | daemon/ntlm.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/daemon/ntlm.c b/daemon/ntlm.c index 28284b9..736ac28 100644 --- a/daemon/ntlm.c +++ b/daemon/ntlm.c @@ -265,6 +265,8 @@ int ntlm_auth_ntlm(ntlm_context_t* ctx, void* key, const char* header, ntlm_connection_t* conn = NULL; unsigned int flags = 0; int ret = HA_FALSE; + size_t len = 0; + void* d; int r; ASSERT(ctx && key && header && resp && buf); @@ -288,13 +290,12 @@ int ntlm_auth_ntlm(ntlm_context_t* ctx, void* key, const char* header, * is sending us. */ - ha_bufdec64(buf, header, 0); - header = ha_bufdata(buf); + d = ha_bufdec64(buf, header, &len); - if(ha_buferr(buf)) + if(!d || len == 0) goto finally; - r = ntlmssp_decode_msg(&ntlmssp, ha_bufdata(buf), ha_buflen(buf), &flags); + r = ntlmssp_decode_msg(&ntlmssp, d, len, &flags); if(r != 0) { ha_messagex(LOG_ERR, "decoding NTLM message failed (error %d)", r); |