aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-09-29 20:40:14 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-09-29 20:40:14 +0200
commita24fa3e3053eccae3981c7a1bf3995d0e67b1036 (patch)
tree9fb44767a4e8aa7f0a37701b832e546f90cd2e5e
parentfdd447a7ea42f8eee89b43d75a65d1ad4516773b (diff)
downloadjson-rpc-shell-a24fa3e3053eccae3981c7a1bf3995d0e67b1036.tar.gz
json-rpc-shell-a24fa3e3053eccae3981c7a1bf3995d0e67b1036.tar.xz
json-rpc-shell-a24fa3e3053eccae3981c7a1bf3995d0e67b1036.zip
Don't try to send an empty method name
-rw-r--r--json-rpc-shell.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/json-rpc-shell.c b/json-rpc-shell.c
index 9edb937..149afa2 100644
--- a/json-rpc-shell.c
+++ b/json-rpc-shell.c
@@ -494,6 +494,11 @@ process_input (struct app_context *ctx, char *user_input)
char *p = input;
while (*p && isspace_ascii (*p))
p++;
+
+ // No input
+ if (!*p)
+ goto fail;
+
char *method = p;
while (*p && !isspace_ascii (*p))
p++;