← Commit list

553d83d42

Rob Landley
Rob Landley
2005-12-18
SOURCE BUG Duration: 13s

Subject

strncmp isn't automatically superior to strcmp. Especially when it isn't used right.

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

loginutils/vlock.c+2 -2
@@ -101,7 +101,7 @@ extern int vlock_main(int argc, char **argv)
}
if (argc == 2) {
- if (strncmp(argv[1], "-a", 2)) {
+ if (strcmp(argv[1], "-a")) {
bb_show_usage();
} else {
o_lock_all = 1;
@@ -199,7 +199,7 @@ extern int vlock_main(int argc, char **argv)
}
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(crypt_pass, 0, strlen(crypt_pass));
restore_terminal();