diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-08-31 15:26:37 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-08-31 15:26:37 +0200 |
commit | 2c47c4f24b314a87e528153486eab9d5a9cd5abc (patch) | |
tree | 64ca0980ac2f8e19cc945d0932c59daec99e3210 /src/tools | |
parent | 63b63e0f6ab9f743fc34623bb1caa9852227f046 (diff) | |
parent | c1f31f6c3ca8bd91d0caaa209e2a1592eebf77d5 (diff) | |
download | ouroboros-2c47c4f24b314a87e528153486eab9d5a9cd5abc.tar.gz ouroboros-2c47c4f24b314a87e528153486eab9d5a9cd5abc.zip |
Merged in dstaesse/ouroboros/be-bugfixing (pull request #231)
tools, irm: Fix segfault with missing parameters
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/irm/irm_bind_api.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/irm/irm_bind_api.c b/src/tools/irm/irm_bind_api.c index b21d305c..abc21b3d 100644 --- a/src/tools/irm/irm_bind_api.c +++ b/src/tools/irm/irm_bind_api.c @@ -40,7 +40,7 @@ int do_bind_api(int argc, char ** argv) pid_t api = -1; char * name = NULL; - while (argc > 0) { + while (argc > 1) { if (matches(*argv, "name") == 0) { name = *(argv + 1); ++argv; @@ -59,7 +59,7 @@ int do_bind_api(int argc, char ** argv) --argc; } - if (api < 0 || name == NULL) { + if (argc == 1 || api < 0 || name == NULL) { usage(); return -1; } |