Skip to content

Commit

Permalink
afppasswd: Check for valid password length, GitHub #931
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed May 1, 2024
1 parent b434be6 commit e8c6ba0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/afppasswd/afppasswd.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ static int update_passwd(const char *path, const char *name, int flags)

/* new password */
passwd = getpass("Enter NEW AFP password: ");
if (strlen(passwd) > 8) {
fprintf(stderr, "afppasswd: max password length is 8.\n");
err = -1;
goto update_done;
}
memcpy(password, passwd, sizeof(password));
password[PASSWDLEN] = '\0';
#ifdef USE_CRACKLIB
Expand Down

0 comments on commit e8c6ba0

Please sign in to comment.