LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File fix-segfault.dif of Package pam_mount.3055 (Project DISCONTINUED:openSUSE:11.3:Update)

Index: pam_mount-1.34/src/pam_mount.c
===================================================================
--- pam_mount-1.34.orig/src/pam_mount.c
+++ pam_mount-1.34/src/pam_mount.c
@@ -346,7 +346,9 @@ PAM_EXTERN EXPORT_SYMBOL int pam_sm_auth
 		ret = pam_set_data(pamh, "pam_mount_system_authtok", authtok,
 		                   clean_system_authtok);
 		if (ret == PAM_SUCCESS) {
-			if (mlock(authtok, strlen(authtok) + 1) < 0)
+			if (authtok == NULL)
+			        w4rn("authtok is NULL in session code\n");
+			else if (mlock(authtok, strlen(authtok) + 1) < 0)
 				w4rn("mlock authtok: %s\n", strerror(errno));
 		} else {
 			l0g("error trying to save authtok for session code\n");