Set retval in the empty password case to avoid a path through the

code that fails to set retval before falling through to the final
return().

Reported by:	emaste
Reported by:	Coverity
CID:		1018711
MFC after:	1 week
This commit is contained in:
Don Lewis 2016-05-16 15:32:02 +00:00
parent 0ab1aa90fa
commit 30f6480075
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299948

View File

@ -332,6 +332,7 @@ pam_sm_chauthtok(pam_handle_t *pamh, int flags,
* XXX check PAM_DISALLOW_NULL_AUTHTOK
*/
old_pass = "";
retval = PAM_SUCCESS;
} else {
retval = pam_get_authtok(pamh,
PAM_OLDAUTHTOK, &old_pass, NULL);