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.
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