From d3b1456c52f7dc4f21cdae2855092fda6b96af4a Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 28 Aug 2018 00:01:26 +0530 Subject: clang-scan: fix multiple issues * Buffer overflow issue in glusterfsd * Null argument passed to function expecting non-null (event-epoll) * Make sure the op_ret value is set in macro (posix) Updates: bz#1622665 Change-Id: I32b378fc40a5e3ee800c0dfbc13335d44c9db9ac Signed-off-by: Amar Tumballi --- xlators/storage/posix/src/posix-inode-handle.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/storage/posix/src/posix-inode-handle.h') diff --git a/xlators/storage/posix/src/posix-inode-handle.h b/xlators/storage/posix/src/posix-inode-handle.h index 33d908fa3de..cb315424dd0 100644 --- a/xlators/storage/posix/src/posix-inode-handle.h +++ b/xlators/storage/posix/src/posix-inode-handle.h @@ -54,14 +54,18 @@ var = NULL; \ } while (0) +/* TODO: it is not a good idea to change a variable which + is not passed to the macro.. Fix it later */ #define MAKE_INODE_HANDLE(rpath, this, loc, iatt_p) do { \ if (!this->private) { \ + op_ret = -1; \ gf_msg ("make_inode_handle", GF_LOG_ERROR, 0, \ P_MSG_INODE_HANDLE_CREATE, \ "private is NULL, fini is already called"); \ break; \ } \ if (gf_uuid_is_null (loc->gfid)) { \ + op_ret = -1; \ gf_msg (this->name, GF_LOG_ERROR, 0, \ P_MSG_INODE_HANDLE_CREATE, \ "null gfid for path %s", (loc)->path); \ -- cgit