<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-forward-container"><br>
      <br>
      -------- Original Message --------
      <table class="moz-email-headers-table" border="0" cellpadding="0"
        cellspacing="0">
        <tbody>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject:
            </th>
            <td>New Defects reported by Coverity Scan for GlusterFS</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
            <td>Mon, 24 Feb 2014 06:54:53 -0800</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
            <td><a class="moz-txt-link-abbreviated" href="mailto:scan-admin@coverity.com">scan-admin@coverity.com</a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <pre>Hi,


Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan.

Defect(s) Reported-by: Coverity Scan
Showing 9 of 9 defect(s)


** CID 1124659:  Negative array index read  (NEGATIVE_RETURNS)
/cli/src/cli-xml-output.c: 3340 in cli_xml_output_vol_rebalance_status()

** CID 1124381:  Logically dead code  (DEADCODE)
/cli/src/cli-xml-output.c: 2422 in cli_xml_output_vol_info_option()

** CID 1124380:  Logically dead code  (DEADCODE)
/cli/src/cli-xml-output.c: 2424 in cli_xml_output_vol_info_option()

** CID 1124829:  Dereference before null check  (REVERSE_INULL)
/cli/src/cli-xml-output.c: 71 in cli_begin_xml_output()

** CID 1124816:  Dereference before null check  (REVERSE_INULL)
/xlators/mgmt/glusterd/src/glusterd-volgen.c: 1825 in init_sethelp_xml_doc()

** CID 1124815:  Dereference before null check  (REVERSE_INULL)
/xlators/mgmt/glusterd/src/glusterd-volgen.c: 1835 in init_sethelp_xml_doc()

** CID 1124731:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-brick-ops.c: 974 in _glusterd_restart_gsync_session()

** CID 1124727:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-geo-rep.c: 2467 in glusterd_op_stage_gsync_set()

** CID 1124795:  Resource leak  (RESOURCE_LEAK)
/xlators/protocol/client/src/client-helpers.c: 237 in unserialize_rsp_direntp()


________________________________________________________________________________________________________
*** CID 1124659:  Negative array index read  (NEGATIVE_RETURNS)
/cli/src/cli-xml-output.c: 3340 in cli_xml_output_vol_rebalance_status()
3334             XML_RET_CHECK_AND_GOTO (ret, out);
3335     
3336             ret = xmlTextWriterWriteFormatElement (writer,(xmlChar *)"status",
3337                                                    "%d", overall_status);
3338             XML_RET_CHECK_AND_GOTO (ret, out);
3339     
&gt;&gt;&gt;     CID 1124659:  Negative array index read  (NEGATIVE_RETURNS)
&gt;&gt;&gt;     Using variable "overall_status" as an index to array "cli_vol_task_status_str".
3340             ret = xmlTextWriterWriteFormatElement (writer,(xmlChar *)"statusStr",
3341                                                    "%s",
3342                                           cli_vol_task_status_str[overall_status]);
3343             XML_RET_CHECK_AND_GOTO (ret, out);
3344     
3345             ret = xmlTextWriterWriteFormatElement (writer,(xmlChar *)"runtime",

________________________________________________________________________________________________________
*** CID 1124381:  Logically dead code  (DEADCODE)
/cli/src/cli-xml-output.c: 2422 in cli_xml_output_vol_info_option()
2416             while (ptr1) {
2417                     if (*ptr1 != *ptr2)
2418                             break;
2419                     ptr1++;
2420                     ptr2++;
2421                     if (!ptr1)
&gt;&gt;&gt;     CID 1124381:  Logically dead code  (DEADCODE)
&gt;&gt;&gt;     Execution cannot reach this statement "goto out;".
2422                             goto out;
2423                     if (!ptr2)
2424                             goto out;
2425             }
2426             if (*ptr2 == '\0')
2427                     goto out;

________________________________________________________________________________________________________
*** CID 1124380:  Logically dead code  (DEADCODE)
/cli/src/cli-xml-output.c: 2424 in cli_xml_output_vol_info_option()
2418                             break;
2419                     ptr1++;
2420                     ptr2++;
2421                     if (!ptr1)
2422                             goto out;
2423                     if (!ptr2)
&gt;&gt;&gt;     CID 1124380:  Logically dead code  (DEADCODE)
&gt;&gt;&gt;     Execution cannot reach this statement "goto out;".
2424                             goto out;
2425             }
2426             if (*ptr2 == '\0')
2427                     goto out;
2428     
2429             /* &lt;option&gt; */

________________________________________________________________________________________________________
*** CID 1124829:  Dereference before null check  (REVERSE_INULL)
/cli/src/cli-xml-output.c: 71 in cli_begin_xml_output()
65     int
66     cli_begin_xml_output (xmlTextWriterPtr *writer, xmlDocPtr *doc)
67     {
68             int             ret = -1;
69     
70             *writer = xmlNewTextWriterDoc (doc, 0);
&gt;&gt;&gt;     CID 1124829:  Dereference before null check  (REVERSE_INULL)
&gt;&gt;&gt;     Null-checking "writer" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
71             if (writer == NULL) {
72                     ret = -1;
73                     goto out;
74             }
75     
76             ret = xmlTextWriterStartDocument (*writer, "1.0", "UTF-8", "yes");

________________________________________________________________________________________________________
*** CID 1124816:  Dereference before null check  (REVERSE_INULL)
/xlators/mgmt/glusterd/src/glusterd-volgen.c: 1825 in init_sethelp_xml_doc()
1819     static int
1820     init_sethelp_xml_doc (xmlTextWriterPtr *writer, xmlBufferPtr  *buf)
1821     {
1822             int ret;
1823     
1824             *buf = xmlBufferCreateSize (8192);
&gt;&gt;&gt;     CID 1124816:  Dereference before null check  (REVERSE_INULL)
&gt;&gt;&gt;     Null-checking "buf" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1825             if (buf == NULL) {
1826                     gf_log ("glusterd", GF_LOG_ERROR, "Error creating the xml "
1827                               "buffer");
1828                     ret = -1;
1829                     goto out;
1830             }

________________________________________________________________________________________________________
*** CID 1124815:  Dereference before null check  (REVERSE_INULL)
/xlators/mgmt/glusterd/src/glusterd-volgen.c: 1835 in init_sethelp_xml_doc()
1829                     goto out;
1830             }
1831     
1832             xmlBufferSetAllocationScheme (*buf,XML_BUFFER_ALLOC_DOUBLEIT);
1833     
1834             *writer = xmlNewTextWriterMemory(*buf, 0);
&gt;&gt;&gt;     CID 1124815:  Dereference before null check  (REVERSE_INULL)
&gt;&gt;&gt;     Null-checking "writer" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1835             if (writer == NULL) {
1836                     gf_log ("glusterd", GF_LOG_ERROR, " Error creating the xml "
1837                              "writer");
1838                     ret = -1;
1839                     goto out;
1840             }

________________________________________________________________________________________________________
*** CID 1124731:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-brick-ops.c: 974 in _glusterd_restart_gsync_session()
968             if (ret)
969                     gf_log ("", GF_LOG_ERROR,
970                             "Unable to restart gsync session.");
971     
972     out:
973             gf_log ("", GF_LOG_DEBUG, "Returning %d.", ret);
&gt;&gt;&gt;     CID 1124731:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "path_list" going out of scope leaks the storage it points to.
974             return ret;
975     }
976     
977     /* op-sm */
978     
979     int

________________________________________________________________________________________________________
*** CID 1124727:  Resource leak  (RESOURCE_LEAK)
/xlators/mgmt/glusterd/src/glusterd-geo-rep.c: 2467 in glusterd_op_stage_gsync_set()
2461     
2462                     break;
2463             }
2464     
2465     out:
2466             gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
&gt;&gt;&gt;     CID 1124727:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "path_list" going out of scope leaks the storage it points to.
2467             return ret;
2468     }
2469     
2470     static int
2471     stop_gsync (char *master, char *slave, char **msg,
2472                 char *conf_path, gf_boolean_t is_force)

________________________________________________________________________________________________________
*** CID 1124795:  Resource leak  (RESOURCE_LEAK)
/xlators/protocol/client/src/client-helpers.c: 237 in unserialize_rsp_direntp()
231     
232                     trav = trav-&gt;nextentry;
233             }
234     
235             ret = 0;
236     out:
&gt;&gt;&gt;     CID 1124795:  Resource leak  (RESOURCE_LEAK)
&gt;&gt;&gt;     Variable "buf" going out of scope leaks the storage it points to.
237             return ret;
238     }
239     
240     int
241     clnt_readdirp_rsp_cleanup (gfs3_readdirp_rsp *rsp)
242     {


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, <a class="moz-txt-link-freetext" href="http://scan.coverity.com/projects/987?tab=Overview">http://scan.coverity.com/projects/987?tab=Overview</a>

To unsubscribe from the email notification for new defects, <a class="moz-txt-link-freetext" href="http://scan5.coverity.com/cgi-bin/unsubscribe.py">http://scan5.coverity.com/cgi-bin/unsubscribe.py</a>



</pre>
      <br>
    </div>
    <br>
  </body>
</html>