File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,9 @@ static int run(int argc, char *argv[]) {
146146 root_hash = argv [5 ];
147147 options = mangle_none (argc > 6 ? argv [6 ] : NULL );
148148
149+ if (!filename_is_valid (volume ))
150+ return log_error_errno (SYNTHETIC_ERRNO (EINVAL ), "Volume name '%s' is not valid." , volume );
151+
149152 r = unhexmem (root_hash , SIZE_MAX , & m , & l );
150153 if (r < 0 )
151154 return log_error_errno (r , "Failed to parse root hash: %m" );
@@ -210,6 +213,9 @@ static int run(int argc, char *argv[]) {
210213
211214 volume = argv [2 ];
212215
216+ if (!filename_is_valid (volume ))
217+ return log_error_errno (SYNTHETIC_ERRNO (EINVAL ), "Volume name '%s' is not valid." , volume );
218+
213219 r = crypt_init_by_name (& cd , volume );
214220 if (r == - ENODEV ) {
215221 log_info ("Volume %s already inactive." , volume );
You can’t perform that action at this time.
0 commit comments