From: Thorsten Kukuk Date: Sun, 18 Sep 2005 10:44:25 +0000 (+0000) Subject: Relevant BUGIDs: none X-Git-Tag: help~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=652b57c94099e205c8881444c425d88b24f42530;p=linux-pam Relevant BUGIDs: none Purpose of commit: bugfix Commit summary: --------------- check if argument which we try to access exists --- diff --git a/modules/pam_selinux/pam_selinux_check.c b/modules/pam_selinux/pam_selinux_check.c index 6ff3fbc0..73c77fa0 100644 --- a/modules/pam_selinux/pam_selinux_check.c +++ b/modules/pam_selinux/pam_selinux_check.c @@ -121,6 +121,9 @@ main (int argc, char **argv) pam_handle_t *pamh; int childPid; + if (argc < 1) + exit (-1); + if (!authenticate_via_pam(argv[1],&pamh)) exit(-1); @@ -149,7 +152,7 @@ main (int argc, char **argv) pam_end( pamh, PAM_SUCCESS ); exit(0); } - argv[0]="/bin/sh"; + argv[0]=strdup ("/bin/sh"); argv[1]=NULL; /* NOTE: The environment has not been sanitized. LD_PRELOAD and other fun