Commit 1ed4471
ceph: fix wrong sizeof argument issue in register_session()
The Coverity Scan service has detected the wrong sizeof
argument in register_session() [1]. The CID 1598909 defect
contains explanation: "The wrong sizeof value is used in
an expression or as argument to a function. The result is
an incorrect value that may cause unexpected program behaviors.
In register_session: The sizeof operator is invoked on
the wrong argument (CWE-569)".
The patch introduces a ptr_size variable that is initialized
by sizeof(struct ceph_mds_session *). And this variable is used
instead of sizeof(void *) in the code.
[1] https://scan5.scan.coverity.com/#/project-view/64304/10063?selectedIssue=1598909
Signed-off-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>1 parent b7ed1e2 commit 1ed4471
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
979 | 979 | | |
980 | 980 | | |
981 | 981 | | |
| 982 | + | |
982 | 983 | | |
983 | 984 | | |
984 | | - | |
| 985 | + | |
985 | 986 | | |
986 | 987 | | |
987 | 988 | | |
988 | 989 | | |
989 | | - | |
| 990 | + | |
990 | 991 | | |
991 | 992 | | |
992 | 993 | | |
| |||
0 commit comments