* src/login.c: Added assert()s for NULL (or ! NULL) username, and
pwd. This helps splint.
This commit is contained in:
parent
e35a7fbd89
commit
2a32262725
@ -1,3 +1,8 @@
|
|||||||
|
2009-04-22 Nicolas François <nicolas.francois@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@centraliens.net>
|
2009-04-22 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* src/login.c: After login_prompt(), do not check for unset
|
* src/login.c: After login_prompt(), do not check for unset
|
||||||
|
@ -347,6 +347,7 @@ static void process_flags (int argc, char *const *argv)
|
|||||||
* Get the user name.
|
* Get the user name.
|
||||||
*/
|
*/
|
||||||
if (optind < argc) {
|
if (optind < argc) {
|
||||||
|
assert (NULL == username);
|
||||||
username = xstrdup (argv[optind]);
|
username = xstrdup (argv[optind]);
|
||||||
strzero (argv[optind]);
|
strzero (argv[optind]);
|
||||||
++optind;
|
++optind;
|
||||||
@ -610,6 +611,7 @@ int main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#ifdef RLOGIN
|
#ifdef RLOGIN
|
||||||
if (rflg) {
|
if (rflg) {
|
||||||
|
assert (NULL == username);
|
||||||
username = xmalloc (USER_NAME_MAX_LENGTH + 1);
|
username = xmalloc (USER_NAME_MAX_LENGTH + 1);
|
||||||
username[USER_NAME_MAX_LENGTH] = '\0';
|
username[USER_NAME_MAX_LENGTH] = '\0';
|
||||||
if (do_rlogin (hostname, username, USER_NAME_MAX_LENGTH, term, sizeof term)) {
|
if (do_rlogin (hostname, username, USER_NAME_MAX_LENGTH, term, sizeof term)) {
|
||||||
@ -1079,6 +1081,8 @@ int main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
} /* while (true) */
|
} /* while (true) */
|
||||||
#endif /* ! USE_PAM */
|
#endif /* ! USE_PAM */
|
||||||
|
assert (NULL != username);
|
||||||
|
assert (NULL != pwd);
|
||||||
|
|
||||||
(void) alarm (0); /* turn off alarm clock */
|
(void) alarm (0); /* turn off alarm clock */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user