From 030d5ef321e7a4884a9f59580fed4d293267d495 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Tue, 21 Aug 2012 18:40:34 +0800 Subject: [PATCH] sbsiglist: check for owner and type arguments ..rather than segfaulting. Signed-off-by: Jeremy Kerr --- src/sbsiglist.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sbsiglist.c b/src/sbsiglist.c index 5be49ac..fab9a4f 100644 --- a/src/sbsiglist.c +++ b/src/sbsiglist.c @@ -242,6 +242,18 @@ int main(int argc, char **argv) ctx->infilename = argv[optind]; + if (!type_str) { + fprintf(stderr, "No type specified\n"); + usage(); + return EXIT_FAILURE; + } + + if (!type_str) { + fprintf(stderr, "No owner specified\n"); + usage(); + return EXIT_FAILURE; + } + ctx->type = parse_type(type_str); if (!ctx->type) { fprintf(stderr, "Invalid type '%s'\n", type_str);