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

Tatsuo Ishii ishii at postgresql.org
Thu Oct 15 09:49:24 JST 2015


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


More information about the pgpool-hackers mailing list