commit | cd649071d8e2442f59c3cf4c692279cf9f63caa6 | [log] [tgz] |
---|---|---|
author | Radek Krejci <rkrejci@cesnet.cz> | Thu Sep 20 12:14:45 2018 +0200 |
committer | Radek Krejci <rkrejci@cesnet.cz> | Thu Sep 20 12:14:45 2018 +0200 |
tree | e0315761ebac1234369a6388a0af59b01ebb2bbd | |
parent | 050264328de9ee8f0effa4f772a7cbde2c591a35 [diff] |
context BUGFIX check input parameters of ly_ctx_unset_searchdirs()
diff --git a/src/context.c b/src/context.c index 891e393..565ee91 100644 --- a/src/context.c +++ b/src/context.c
@@ -132,6 +132,9 @@ API LY_ERR ly_ctx_unset_searchdirs(struct ly_ctx *ctx, int index) { + LY_CHECK_ARG_RET(ctx, ctx, LY_EINVAL); + LY_CHECK_ERR_RET(index >= 0 && (unsigned int)index >= ctx->search_paths.count, LOGARG(ctx, index), LY_EINVAL); + if (!ctx->search_paths.count) { return LY_SUCCESS; }