strncmp isn't automatically superior to strcmp. Especially when it isn't
used right.
This commit is contained in:
parent
9bdd742dd2
commit
553d83d427
@ -101,7 +101,7 @@ extern int vlock_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
if (strncmp(argv[1], "-a", 2)) {
|
if (strcmp(argv[1], "-a")) {
|
||||||
bb_show_usage();
|
bb_show_usage();
|
||||||
} else {
|
} else {
|
||||||
o_lock_all = 1;
|
o_lock_all = 1;
|
||||||
@ -199,7 +199,7 @@ extern int vlock_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
crypt_pass = pw_encrypt(pass, pw->pw_passwd);
|
crypt_pass = pw_encrypt(pass, pw->pw_passwd);
|
||||||
if (strncmp(crypt_pass, pw->pw_passwd, sizeof(crypt_pass)) == 0) {
|
if (strcmp(crypt_pass, pw->pw_passwd) == 0) {
|
||||||
memset(pass, 0, strlen(pass));
|
memset(pass, 0, strlen(pass));
|
||||||
memset(crypt_pass, 0, strlen(crypt_pass));
|
memset(crypt_pass, 0, strlen(crypt_pass));
|
||||||
restore_terminal();
|
restore_terminal();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user