diff options
author | Karel Zak | 2019-05-23 15:32:59 +0200 |
---|---|---|
committer | Karel Zak | 2019-05-23 15:32:59 +0200 |
commit | e4c6816cc34dd611ccbe0633aa222bd6dbae2572 (patch) | |
tree | b20e4cc4af474a4231f643549910227b8a46f165 /sys-utils | |
parent | hwclock: don't use uninitialized value [coverity scan] (diff) | |
download | kernel-qcow2-util-linux-e4c6816cc34dd611ccbe0633aa222bd6dbae2572.tar.gz kernel-qcow2-util-linux-e4c6816cc34dd611ccbe0633aa222bd6dbae2572.tar.xz kernel-qcow2-util-linux-e4c6816cc34dd611ccbe0633aa222bd6dbae2572.zip |
ipcs: check return value when read from /proc [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils')
-rw-r--r-- | sys-utils/ipcutils.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys-utils/ipcutils.c b/sys-utils/ipcutils.c index 5fe297fd4..e5ead7ba6 100644 --- a/sys-utils/ipcutils.c +++ b/sys-utils/ipcutils.c @@ -22,9 +22,12 @@ int ipc_msg_get_limits(struct ipc_limits *lim) access(_PATH_PROC_IPC_MSGMNB, F_OK) == 0 && access(_PATH_PROC_IPC_MSGMAX, F_OK) == 0) { - ul_path_read_s32(NULL, &lim->msgmni, _PATH_PROC_IPC_MSGMNI); - ul_path_read_s32(NULL, &lim->msgmnb, _PATH_PROC_IPC_MSGMNB); - ul_path_read_u64(NULL, &lim->msgmax, _PATH_PROC_IPC_MSGMAX); + if (ul_path_read_s32(NULL, &lim->msgmni, _PATH_PROC_IPC_MSGMNI) != 0) + return 1; + if (ul_path_read_s32(NULL, &lim->msgmnb, _PATH_PROC_IPC_MSGMNB) != 0) + return 1; + if (ul_path_read_u64(NULL, &lim->msgmax, _PATH_PROC_IPC_MSGMAX) != 0) + return 1; } else { struct msginfo msginfo; |