PERFORCE change 33312 for review
Dag-Erling Smorgrav
des at FreeBSD.org
Wed Jun 18 02:15:38 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=33312
Change 33312 by des at des.at.des.thinksec.com on 2003/06/18 02:14:58
Checking the return value from pam_get_item(3) isn't enough, we also
have to check that the item isn't NULL.
Submitted by: marcus
Affected files ...
.. //depot/projects/openpam/lib/pam_get_user.c#18 edit
Differences ...
==== //depot/projects/openpam/lib/pam_get_user.c#18 (text+ko) ====
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/pam_get_user.c#17 $
+ * $P4: //depot/projects/openpam/lib/pam_get_user.c#18 $
*/
#include <sys/param.h>
@@ -43,7 +43,7 @@
#include "openpam_impl.h"
-const char user_prompt[] = "Login:";
+static const char user_prompt[] = "Login:";
/*
* XSSO 4.2.1
@@ -64,7 +64,7 @@
if (pamh == NULL || user == NULL)
RETURNC(PAM_SYSTEM_ERR);
r = pam_get_item(pamh, PAM_USER, (const void **)user);
- if (r == PAM_SUCCESS)
+ if (r == PAM_SUCCESS && *user != NULL)
RETURNC(PAM_SUCCESS);
if (prompt == NULL) {
r = pam_get_item(pamh, PAM_USER_PROMPT, (const void **)&prompt);
More information about the p4-projects
mailing list