mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-24 00:59:19 +02:00
#24: Add length check on topdomain, <= 128 chars
This commit is contained in:
parent
4e582e98c6
commit
17c41d87bc
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue