summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2022-08-08 02:07:57 -0400
committerJeffrey Walton <noloader@gmail.com>2022-08-08 02:07:57 -0400
commit94aba0105efa92fcb3c8ba1a125e17af72a1894d (patch)
treee1316e50afc8ffe80f47a6e56492895f55039cf7
parent511806c0eba8ba5b5cedd4b4a814e96df92864a6 (diff)
downloadcryptopp-git-94aba0105efa92fcb3c8ba1a125e17af72a1894d.tar.gz
Fix segfault with no-arg invocation of cryptest program (GH #1141)
This break was introduced at 6f3fd26ab849ac71
-rw-r--r--test.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/test.cpp b/test.cpp
index 73ab4392..842fde8e 100644
--- a/test.cpp
+++ b/test.cpp
@@ -426,7 +426,7 @@ int scoped_main(int argc, char *argv[])
else if (command == "h")
{
FileSource usage(DataDir("TestData/usage.dat").c_str(), true, new FileSink(std::cout));
- return argv[1][0] == 'h' ? 0 : 1;
+ return argc >= 2 && argv[1][0] == 'h' ? 0 : 1;
}
else if (command == "V")
{