Skip to content

Commit

Permalink
main BUGFIX invalid memory access on rpc
Browse files Browse the repository at this point in the history
Fixes #1695
  • Loading branch information
Roytak committed Jan 31, 2025
1 parent 40de43a commit 2efb81d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ set(LIBNETCONF2_DEP_SOVERSION 4.5.1)
set(LIBNETCONF2_DEP_SOVERSION_MAJOR 4)

# sysrepo required version
set(SYSREPO_DEP_VERSION 3.4.3)
set(SYSREPO_DEP_SOVERSION 7.30.0)
set(SYSREPO_DEP_VERSION 3.4.8)
set(SYSREPO_DEP_SOVERSION 7.30.5)
set(SYSREPO_DEP_SOVERSION_MAJOR 7)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99")
Expand Down
8 changes: 6 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,13 @@ np2srv_rpc_cb(struct lyd_node *rpc, struct nc_session *ncs)

/* error reply */
reply = np_reply_err_sr(user_sess->sess, LYD_NAME(rpc));
} else if (output) {
/* data reply */
reply = np_reply_success(rpc, output->tree);
output->tree = NULL;
} else {
/* OK/data reply */
reply = np_reply_success(rpc, output ? output->tree : NULL);
/* OK reply */
reply = np_reply_success(rpc, NULL);
}
}

Expand Down

0 comments on commit 2efb81d

Please sign in to comment.