From c23c207b13062dfc9eff9bf512f9240b96fd6a2c Mon Sep 17 00:00:00 2001 From: ljedrz Date: Thu, 22 Jun 2023 13:53:38 +0200 Subject: [PATCH] tweak: forbid empty key values Signed-off-by: ljedrz --- cli/src/commands/start.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cli/src/commands/start.rs b/cli/src/commands/start.rs index 06c60879c1..3668f6f78d 100644 --- a/cli/src/commands/start.rs +++ b/cli/src/commands/start.rs @@ -180,9 +180,13 @@ impl Start { bail!("Both the private key string and file path flags were specified, please pick only one"); } - // If the private key is provided directly, don't do anything else. - if self.private_key.is_some() { - return Ok(()); + // If the private key is provided directly, don't do anything else; make sure it's non-empty too. + if let Some(private_key) = &self.private_key { + if private_key.is_empty() { + bail!("The private-key argument can't be empty"); + } else { + return Ok(()); + } } // If a filesystem path to the private key is provided, attempt to