[ 
https://issues.apache.org/jira/browse/HAWQ-263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15063719#comment-15063719
 ] 

ASF GitHub Bot commented on HAWQ-263:
-------------------------------------

GitHub user huor opened a pull request:

    https://github.com/apache/incubator-hawq/pull/202

    HAWQ-263. Fix "Wrong sizeof argument (SIZEOF_MISMATCH)" issue in 
MoveOutCGroupForQE found by Coverity

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/huor/incubator-hawq github_huor_coverity

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-hawq/pull/202.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #202
    
----
commit c6ddf2477eaa91f18018dec38c17e4eb9fd21a7f
Author: Ruilong Huo <[email protected]>
Date:   2015-12-18T09:05:05Z

    HAWQ-263. Fix 'Wrong sizeof argument (SIZEOF_MISMATCH)' issue in 
MoveOutCGroupForQE found by Coverity

----


> "Wrong sizeof argument (SIZEOF_MISMATCH)" issue in MoveOutCGroupForQE found 
> by Coverity
> ---------------------------------------------------------------------------------------
>
>                 Key: HAWQ-263
>                 URL: https://issues.apache.org/jira/browse/HAWQ-263
>             Project: Apache HAWQ
>          Issue Type: Bug
>          Components: Resource Manager
>    Affects Versions: 2.0.0-beta-incubating
>            Reporter: Ruilong Huo
>            Assignee: Ruilong Huo
>
> Per Covertiy scan, there is "Wrong sizeof argument (SIZEOF_MISMATCH)" issue 
> in MoveOutCGroupForQE in resource enforcement.
> {noformat}
>  82/**
>  83 * Move the QE PID out of corresponding CGroup
>  84 */
>  85int
>  86MoveOutCGroupForQE(TimestampTz masterStartTime,
>  87                                   int connId,
>  88                                   int segId,
>  89                                   int procId,
>  90                                   char *errorbuf,
>  91                                   int errorbufsize)
>  92{
>  93#ifdef __linux
>  94        initializeQE2RMSEGComm();
>  95
>  96        int                     res                     = FUNC_RETURN_OK;
>  97
>  98        char            *serverHost     = "127.0.0.1";
>  99        uint16_t        serverPort      = rm_segment_port;
> 100
> 101        SelfMaintainBuffer sendBuffer = 
> createSelfMaintainBuffer(CurrentMemoryContext);
> 102        SelfMaintainBuffer recvBuffer = 
> createSelfMaintainBuffer(CurrentMemoryContext);
> 103
> 104        /* Build request */
> 105        RPCRequestMoveOutCGroupData request;
> 106        request.MasterStartTime = masterStartTime;
> 107        request.ConnID          = connId;
> 108        request.SegmentID               = segId;
> 109        request.ProcID                  = procId;
> 110        appendSMBVar(sendBuffer, request);
> 111
> 112        /* Send request */
>       
> CID 16865 (#1 of 1): Wrong sizeof argument (SIZEOF_MISMATCH)
> suspicious_sizeof: Passing argument serverHost of type char * and argument 8 
> /* sizeof (errorbuf) */ to function callSyncRPCRemote is suspicious.
> 113        res = callSyncRPCRemote(serverHost,
> 114                                serverPort,
> 115                                sendBuffer->Buffer,
> 116                                sendBuffer->Cursor+1,
> 117                                REQUEST_QE_MOVEOUTCGROUP,
> 118                                RESPONSE_QE_MOVEOUTCGROUP,
> 119                                recvBuffer,
> 120                                                        errorbuf,
> 121                                                        sizeof(errorbuf));
> 122
> 123        deleteSelfMaintainBuffer(sendBuffer);
> 124        deleteSelfMaintainBuffer(recvBuffer);
> 125        return res;
> 126#endif
> 127        return FUNC_RETURN_OK;
> 128}
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to