[Pkg-shadow-commits] r2751 - in upstream/trunk: . src

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Wed Apr 22 20:51:13 UTC 2009


Author: nekral-guest
Date: 2009-04-22 20:51:13 +0000 (Wed, 22 Apr 2009)
New Revision: 2751

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/login.c
Log:
	* src/login.c: Added assert()s for NULL (or ! NULL) username, and
	pwd. This helps splint.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-22 20:48:42 UTC (rev 2750)
+++ upstream/trunk/ChangeLog	2009-04-22 20:51:13 UTC (rev 2751)
@@ -1,5 +1,10 @@
 2009-04-22  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/login.c: Added assert()s for NULL (or ! NULL) username, and
+	pwd. This helps splint.
+
+2009-04-22  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/login.c: After login_prompt(), do not check for unset
 	username, but for empty username.
 

Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c	2009-04-22 20:48:42 UTC (rev 2750)
+++ upstream/trunk/src/login.c	2009-04-22 20:51:13 UTC (rev 2751)
@@ -347,6 +347,7 @@
 	 *  Get the user name.
 	 */
 	if (optind < argc) {
+		assert (NULL == username);
 		username = xstrdup (argv[optind]);
 		strzero (argv[optind]);
 		++optind;
@@ -610,6 +611,7 @@
 	}
 #ifdef RLOGIN
 	if (rflg) {
+		assert (NULL == username);
 		username = xmalloc (USER_NAME_MAX_LENGTH + 1);
 		username[USER_NAME_MAX_LENGTH] = '\0';
 		if (do_rlogin (hostname, username, USER_NAME_MAX_LENGTH, term, sizeof term)) {
@@ -1079,6 +1081,8 @@
 		}
 	}			/* while (true) */
 #endif				/* ! USE_PAM */
+	assert (NULL != username);
+	assert (NULL != pwd);
 
 	(void) alarm (0);		/* turn off alarm clock */
 




More information about the Pkg-shadow-commits mailing list