id128: when taking user input for a 128bit ID, validate syntax
Also, always accept both our simple hexdump syntax and UUID syntax.
This commit is contained in:
@@ -222,6 +222,11 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case ARG_UUID:
|
||||
if (!id128_is_valid(optarg)) {
|
||||
log_error("Invalid UUID: %s", optarg);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
arg_uuid = optarg;
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user