Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 May 2003 08:57:19 -0700 (PDT)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 30310 for review
Message-ID:  <200305011557.h41FvJ4B066958@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=30310

Change 30310 by des@des.at.des.thinksec.com on 2003/05/01 08:57:17

	Variable initialization issues.

Affected files ...

.. //depot/projects/openpam/lib/pam_set_item.c#18 edit

Differences ...

==== //depot/projects/openpam/lib/pam_set_item.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_set_item.c#17 $
+ * $P4: //depot/projects/openpam/lib/pam_set_item.c#18 $
  */
 
 #include <sys/param.h>
@@ -62,6 +62,7 @@
 	if (pamh == NULL)
 		RETURNC(PAM_SYSTEM_ERR);
 	slot = &pamh->item[item_type];
+	osize = nsize = 0;
 	switch (item_type) {
 	case PAM_SERVICE:
 	case PAM_USER:
@@ -73,10 +74,10 @@
 	case PAM_USER_PROMPT:
 	case PAM_AUTHTOK_PROMPT:
 	case PAM_OLDAUTHTOK_PROMPT:
+		if (*slot != NULL)
+			osize = strlen(*slot) + 1;
 		if (item != NULL)
 			nsize = strlen(item) + 1;
-		if (*slot != NULL)
-			osize = strlen(*slot) + 1;
 		break;
 	case PAM_REPOSITORY:
 		osize = nsize = sizeof(struct pam_repository);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305011557.h41FvJ4B066958>