diff --git a/src/iodine.c b/src/iodine.c index 7e21e41..904ee0c 100644 --- a/src/iodine.c +++ b/src/iodine.c @@ -582,6 +582,10 @@ main(int argc, char **argv) usage(); 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) { pw = getpwnam(username); diff --git a/src/iodined.c b/src/iodined.c index dd590fd..5ab7242 100644 --- a/src/iodined.c +++ b/src/iodined.c @@ -521,6 +521,10 @@ main(int argc, char **argv) usage(); 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) { pw = getpwnam(username);