<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/91225>91225</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:1300: 2 * missing bounds check ?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lldb,
            code-quality
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dcb314
      </td>
    </tr>
</table>

<pre>
    Static analyser cppcheck says:

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:1300:75: warning: Missing bounds check for extra iterator increment in loop. [StlMissingComparison]

Source code is

  for (std::string::const_iterator c = packet.begin(); c != packet.end(); ++c) {
  ...
  int repeat_count = *++c + 3 - ' ';
   ...
   char escapee = *++c ^ 0x20;

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0U8FyozgU_JrHRWVKPKFgDhzseL2nrdrafEBKEi9YGyExkpiJ_35KxElcNXOdA9BFo-7Wo6VSspMnGkAeQZ4qteZLiMNotGjaSofxOjxlla1hyit3TRSZWRZzIfPKkromEAfgJ-C3u3OjBjynsEZDgOd_3TpZnwqKwVAqaBr1LtIccvng79Pxvw0_hnlevTUq2-BrsywgDo3gHMShkyAO7IeK3vqpwH9sStZPTIfVj4m9p3kJkdFbjorZTFHlEJn1JtJMPjPrmQthqRnI41N2N4HHMC8q2hQ8yNP9Np62_MyEkZhN9wzbfAD3KY9l7-KQcnyPBeJggk_5-dPfMBAntijzSrnWNFkPuAfsQRwLh80dTX78IgGPgEcD2DPojh_OdV1_QOszi7SQys8mrD5vRoCH28IiwATbMcCuXCA-Re5VmLmoyCgZtRD9IiH_YvwN-efaahzE2IteVTQ0XSM579pOVpdBKUFd17807Yvam1Y_aC36_b5rOd93D1JXdkCOLZf8oWllJ2WNe81Nj0I2HSdsOmg5zcq62rnvcx3iVNmUVhr6BlFWTmlyaWso4nvDEPAREMsP2n1blbP5Wl7KUxWHorHT65Sg5c6mnL5Us82Ohj9SUoZleGz-XTVBnKs1uuGS87KdGDwXC5svq65NmAHPJeLtsVti-J9MBjxvUyhxtkH8DAAA__9VCR2n">