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

Commits on Jul 25, 2019

  1. src/test: s/strcpy/strncpy

    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>
    Songweibin committed Jul 25, 2019
    Copy the full SHA
    0c70668 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2019

  1. src/crush: check before dereference out2

    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>
    Songweibin committed Jul 26, 2019
    Copy the full SHA
    e027012 View commit details
    Browse the repository at this point in the history
  2. src/mount: check before dereference buf

    CID 180671 (ceph#1 of 1): Dereference null return value (NULL_RETURNS)
    
    Signed-off-by: songweibin <song.weibin@zte.com.cn>
    Songweibin committed Jul 26, 2019
    Copy the full SHA
    b737cc4 View commit details
    Browse the repository at this point in the history
  3. src/tools: initialize variables before the goto statement

    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>
    Songweibin committed Jul 26, 2019
    Copy the full SHA
    1428c6e View commit details
    Browse the repository at this point in the history
  4. common,tools: make sure the destination buffer can handle the size of…

    … 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 committed Jul 26, 2019
    Copy the full SHA
    5e8c412 View commit details
    Browse the repository at this point in the history