alexbrainman / sspi

Windows SSPI
BSD 3-Clause "New" or "Revised" License
84 stars 27 forks source link

Correctly handle empty password in AcquireUserCredentials #5

Closed enj closed 6 years ago

enj commented 6 years ago

The current code will panic with an index out of bound error when an empty password is passed to AcquireUserCredentials. It assumes that p is always a valid slice but it is nil when no password is given. The panic occurs at Password: &p[0].

This change removes the special handling of the empty password. Thus syscall.UTF16FromString(password) is always called which guarantees that p is always a valid slice.

Signed-off-by: Monis Khan mkhan@redhat.com

enj commented 6 years ago

@alexbrainman PTAL