tFix segfault when no key is provided - sick - sign and check files using ed25519
HTML git clone git://z3bra.org/sick
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 6474eebf7cc43835889c573f0905530e4244e952
DIR parent cf7487682de47853e36e36330ac80b0c0388562f
HTML Author: z3bra <willyatmailoodotorg>
Date: Sun, 15 May 2016 20:08:43 +0200
Fix segfault when no key is provided
Diffstat:
M sick.c | 10 ++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)
---
DIR diff --git a/sick.c b/sick.c
t@@ -17,6 +17,12 @@ enum {
ACT_CHCK
};
+enum {
+ ERR_NOKEY,
+ ERR_NOSIG,
+ ERR_NOMSG
+};
+
static void usage();
static size_t bufferize(char **buf, FILE *fp);
static size_t extractmsg(unsigned char *msg[], char *buf);
t@@ -254,6 +260,10 @@ main(int argc, char *argv[])
usage();
}ARGEND;
+ if (key == NULL) {
+ return ERR_NOKEY;
+ }
+
if (!argc) {
fp = stdin;
switch (action) {