From 5e2ea3c86dc480a75877d9395fc3b4d2c6cc5223 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Tue, 8 Aug 2017 11:14:45 -0700 Subject: [PATCH] libkvs/dir: kvsdir_create handle invalid arguments --- src/common/libkvs/kvs_dir.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/libkvs/kvs_dir.c b/src/common/libkvs/kvs_dir.c index a6eea14be063..e0ad750e5ef2 100644 --- a/src/common/libkvs/kvs_dir.c +++ b/src/common/libkvs/kvs_dir.c @@ -71,6 +71,10 @@ kvsdir_t *kvsdir_create (flux_t *handle, const char *rootref, { kvsdir_t *dir; + if (!key || !json_str) { + errno = EINVAL; + return NULL; + } if (!(dir = calloc (1, sizeof (*dir)))) goto nomem;