#24: Add length check on topdomain, <= 128 chars

This commit is contained in:
Erik Ekman 2007-07-11 23:25:03 +00:00 committed by Erik Ekman
parent 25e51c666a
commit 861da5d022
2 changed files with 8 additions and 0 deletions

View file

@ -582,6 +582,10 @@ main(int argc, char **argv)
usage(); usage();
topdomain = strdup(argv[1]); topdomain = strdup(argv[1]);
if (strlen(topdomain) > 128 || topdomain[0] == '.') {
printf("Use a topdomain max 128 chars long. Do not start it with a dot.\n");
usage();
}
if(username) { if(username) {
pw = getpwnam(username); pw = getpwnam(username);

View file

@ -521,6 +521,10 @@ main(int argc, char **argv)
usage(); usage();
topdomain = strdup(argv[1]); topdomain = strdup(argv[1]);
if (strlen(topdomain) > 128 || topdomain[0] == '.') {
printf("Use a topdomain max 128 chars long. Do not start it with a dot.\n");
usage();
}
if (username) { if (username) {
pw = getpwnam(username); pw = getpwnam(username);