[pgpool-hackers: 1111] Re: Coverity issues in master branch as of 2015/10/15

Muhammad Usama m.usama at gmail.com
Thu Oct 15 20:50:30 JST 2015


Hi

I have pushed the fix for the above issues.

Thanks
Best regards
Muhammad Usama

On Thu, Oct 15, 2015 at 5:49 AM, Tatsuo Ishii <ishii at postgresql.org> wrote:

> Usama,
>
> Can you please fix below? It seems it was introduced by you.
>
>
> -------------------------------------------------------------------------------------------
> 1) pool_memqcacache.c
>
>                /*
> 1107                 * This need to live throughout the life of child so
> home it in
> 1108                 * TopMemoryContext
> 1109                 */
> 1110                oldcxt = MemoryContextSwitchTo(TopMemoryContext);
> 1111                tmp = repalloc(oidbuf, sizeof(int) * oidbuf_size);
>     CID 1304568 (#1 of 1): Unused value (UNUSED_VALUE)returned_pointer:
> Pointer oldcxt returned by MemoryContextSwitchTo(oldcxt) is never used.
> 1112                oldcxt = MemoryContextSwitchTo(oldcxt);
>
>
> -------------------------------------------------------------------------------------------
>
> 2) pcp.c
>
> 620                else
>    CID 1261615 (#1 of 1): Logically dead code (DEADCODE)dead_error_line:
> Execution cannot reach this statement pcp_internal_error(pcpConn,....
> 621                        pcp_internal_error(pcpConn,
> 622                                                           "command
> failed. invalid response");
>
>
>  904
>     assignment: Assigning: index = (char *)memchr(index, 0, len) + 1.
>  905                index = (char *) memchr(index, '\0', len) + 1;
>     notnull: At condition index == NULL, the value of index cannot be NULL.
>     dead_error_condition: The condition index == NULL cannot be true.
>  906                if(index == NULL)
>     CID 1261613 (#1 of 12): Logically dead code (DEADCODE)dead_error_line:
> Execution cannot reach this statement goto INVALID_RESPONSE;.
>  907                        goto INVALID_RESPONSE;
>  908
>
> 1
>     assignment: Assigning: index = (char *)memchr(index, 0, len) + 1.
> 1112                index = (char *) memchr(index, '\0', len) + 1;
>     notnull: At condition index == NULL, the value of index cannot be NULL.
>     dead_error_condition: The condition index == NULL cannot be true.
> 1113                if(index == NULL)
>     CID 1261612 (#1 of 3): Logically dead code (DEADCODE)dead_error_line:
> Execution cannot reach this statement goto INVALID_RESPONSE;.
>
>
> -------------------------------------------------------------------------------------------
> 3) pcp_worker.c
>
>     arith_non_null: The result of pointer arithmetic (char *)memchr(buf,
> 0, len) + 1 is never null.
>     assignment: Assigning: param_value = (char *)memchr(buf, 0, len) + 1.
> 1188        param_value = (char *) memchr(buf, '\0', len) + 1;
>     notnull: At condition param_value == NULL, the value of param_value
> cannot be NULL.
>     dead_error_condition: The condition param_value == NULL cannot be true.
> 1189        if(param_value == NULL)
> 1190                ereport(ERROR,
> 1191                        (errmsg("set configuration parameter failed"),
>     CID 1261611 (#1 of 1): Logically dead code (DEADCODE)dead_error_begin:
> Execution cannot reach this statement do  {
>
>   int const elevel_ =....
> 1192                                 errdetail("invalid pcp packet
> received from client")));
> 1193
>
> -------------------------------------------------------------------------------------------
>
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20151015/b5a663fe/attachment.html>


More information about the pgpool-hackers mailing list