sick

sign and check files using ed25519
git clone git://z3bra.org/sick
Log | Files | Refs | Submodules | README | LICENSE

commit 6474eebf7cc43835889c573f0905530e4244e952
parent cf7487682de47853e36e36330ac80b0c0388562f
Author: z3bra <willyatmailoodotorg>
Date:   Sun May 15 20:08:43 2016

Fix segfault when no key is provided

Diffstat:
 sick.c | 10 ++++++++++
 1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/sick.c b/sick.c @@ -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); @@ -254,6 +260,10 @@ main(int argc, char *argv[]) usage(); }ARGEND; + if (key == NULL) { + return ERR_NOKEY; + } + if (!argc) { fp = stdin; switch (action) {