<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <dl style="line-height: 1.5; margin-left: 2em">
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
      <dd style="margin-left: 8.5em">Kouhei Sutou &lt;kou****@clear*****&gt;</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
      <dd style="margin-left: 8.5em">2012-04-16 23:47:13 +0900 (Mon, 16 Apr 2012)</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
      <dd style="margin-left: 8.5em"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9">b2a643e87b643417daec960efb74cebe4513d5d9</a></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Log</dt>
      <dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; padding: 0.5em">wrapper: use memcpy() instead of '=' for delegating dup_ref value

We should copy values insated of share them because &quot;share&quot; may cause
double free.

refs #1301</pre></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
      <dd style="margin-left: 8.5em">
        <ul>
          <li><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#diff-0">ha_mroonga.cpp</a></li>
        </ul>
      </dd>
    </dl>

    <div class="diff-section" style="clear: both">
      <table style="border-collapse: collapse; border: 1px solid #aaa">
        <thead>
          <tr class="diff-header" style="border: 1px solid #aaa">
            <td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">  Modified: ha_mroonga.cpp (+1 -3)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
            </td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3761">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3762">3762</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3763">3763</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3764">3764</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3765">3765</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3766">3766</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3767">3767</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3768">3768</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3769">3769</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3770">3770</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3771">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3772">3772</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3773">3773</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3774">3774</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3775">3775</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3776">3776</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0L3777">3777</a></span>
</pre>
            </th>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3761">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3762">3762</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3763">3763</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3764">3764</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3765">3765</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3766">3766</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3767">3767</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3768">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3769">3769</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3770">3770</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3771">3771</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3772">3772</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3773">3773</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3774">3774</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/b2a643e87b643417daec960efb74cebe4513d5d9#L0R3775">3775</a></span>
</pre>
            </th>
            <td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -3762,9 +3762,6 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">int ha_mroonga::wrapper_info(uint flag)</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   int error = 0;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   MRN_DBUG_ENTER_METHOD();</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-  if (flag &amp; HA_STATUS_ERRKEY) {</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-    wrap_handler-&gt;dup_ref = dup_ref;</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-  }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   MRN_SET_WRAP_SHARE_KEY(share, table-&gt;s);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   MRN_SET_WRAP_TABLE_KEY(this, table);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   error = wrap_handler-&gt;info(flag);</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -3772,6 +3769,7 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">int ha_mroonga::wrapper_info(uint flag)</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">   MRN_SET_BASE_TABLE_KEY(this, table);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   if (flag &amp; HA_STATUS_ERRKEY) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     errkey = wrap_handler-&gt;errkey;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    memcpy(dup_ref, wrap_handler-&gt;dup_ref, wrap_handler-&gt;ref_length);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   if (flag &amp; HA_STATUS_TIME) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     stats.update_time = wrap_handler-&gt;stats.update_time;</span>
</pre>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>