Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common,tools,crush,test: misc converity & klocwork fixes #29316

Merged
merged 5 commits into from Jul 27, 2019

Conversation

Songweibin
Copy link
Contributor

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

fix klocwork issues:
function 'strcpy' does not check buffer boundaries but outputs to buffer 'watcher.addr' of fixed size (256)

Signed-off-by: songweibin <song.weibin@zte.com.cn>
@neha-ojha neha-ojha requested a review from tchaikov July 25, 2019 18:43
src/crush/mapper.c Show resolved Hide resolved
src/mount/mount.ceph.c Outdated Show resolved Hide resolved
CID 174874 (ceph#2 of 2): Dereference after null check (FORWARD_NULL)
30. var_deref_op: Dereference null pointer out2.

Signed-off-by: songweibin <song.weibin@zte.com.cn>
CID 180671 (ceph#1 of 1): Dereference null return value (NULL_RETURNS)

Signed-off-by: songweibin <song.weibin@zte.com.cn>
CID 172143 (ceph#15 of 15): Branch past initialization (PW.BRANCH_PAST_INITIALIZATION)
1. branch_past_initialization:
2. name_at_decl_position: variable "oid" (declared at line 220)
3. name_at_decl_position: variable "exkeys" (declared at line 241)
4. name_at_decl_position: variable "exvals" (declared at line 242)
5. name_at_decl_position: variable "safe" (declared at line 278)

Signed-off-by: songweibin <song.weibin@zte.com.cn>
… the string

fix klocwork issues:
Width is not specified for 's' conversion specifier.
This can result in an overflow of the buffer
provided in argument 3 of a call to 'sscanf'

Signed-off-by: songweibin <song.weibin@zte.com.cn>
@Songweibin
Copy link
Contributor Author

@tchaikov Updated, please take a look, thank you.

@liewegas liewegas merged commit 5e8c412 into ceph:master Jul 27, 2019
liewegas added a commit that referenced this pull request Jul 27, 2019
* refs/pull/29316/head:
	common,tools: make sure the destination buffer can handle the size of the string
	src/tools: initialize variables before the goto statement
	src/mount: check before dereference buf
	src/crush: check before dereference out2
	src/test: s/strcpy/strncpy

Reviewed-by: Neha Ojha <nojha@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
@Songweibin Songweibin deleted the wip-fix-cov-kw branch July 29, 2019 00:36
runsisi pushed a commit to runsisi/ceph that referenced this pull request Aug 5, 2019
pick from ceph#29316

Change-Id: Ia0c42515d57fdc96cf1be376868b3c544113849f
Signed-off-by: songweibin <song.weibin@zte.com.cn>
runsisi pushed a commit to ceph/ceph-ci that referenced this pull request Oct 22, 2019
pick from ceph/ceph#29316

Change-Id: Ia0c42515d57fdc96cf1be376868b3c544113849f
Signed-off-by: songweibin <song.weibin@zte.com.cn>
xiexingguo pushed a commit to ceph/ceph-ci that referenced this pull request Nov 26, 2019
pick from ceph/ceph#29316

Change-Id: Ia0c42515d57fdc96cf1be376868b3c544113849f
Signed-off-by: songweibin <song.weibin@zte.com.cn>
Yan-waller pushed a commit to ceph/ceph-ci that referenced this pull request May 6, 2020
pick from ceph/ceph#29316

Change-Id: Ia0c42515d57fdc96cf1be376868b3c544113849f
Signed-off-by: songweibin <song.weibin@zte.com.cn>
xiexingguo pushed a commit to ceph/ceph-ci that referenced this pull request Jul 4, 2020
pick from ceph/ceph#29316

Change-Id: Ia0c42515d57fdc96cf1be376868b3c544113849f
Signed-off-by: songweibin <song.weibin@zte.com.cn>
xiexingguo pushed a commit to ceph/ceph-ci that referenced this pull request Jul 10, 2020
pick from ceph/ceph#29316

Change-Id: Ia0c42515d57fdc96cf1be376868b3c544113849f
Signed-off-by: songweibin <song.weibin@zte.com.cn>
Songweibin added a commit to ceph/ceph-ci that referenced this pull request Nov 28, 2020
pick from ceph/ceph#29316

Change-Id: Ia0c42515d57fdc96cf1be376868b3c544113849f
Signed-off-by: songweibin <song.weibin@zte.com.cn>
Songweibin added a commit to ceph/ceph-ci that referenced this pull request Apr 22, 2021
pick from ceph/ceph#29316

Change-Id: Ia0c42515d57fdc96cf1be376868b3c544113849f
Signed-off-by: songweibin <song.weibin@zte.com.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants