Out-of-bounds in url converter #851

issue mad opened this issue on February 16, 2012
  1. mad commented at 4:22 PM on February 16, 2012: none

    When is '//' removed we access i + 2 indecies. But array is 257 length and iterate until 256, on last iteration 255 + 2 == 257 and we out-of-bounds.

    There:

    https://github.com/bitcoin/bitcoin/blob/master/src/qt/qtipcserver.cpp#L37 https://github.com/bitcoin/bitcoin/blob/master/src/qt/qtipcserver.cpp#L73

  2. gmaxwell commented at 4:38 PM on February 16, 2012: contributor

    Without // that loop does not even run, oh I see what you're saying "In the code where it removes //", yes that code bothered me too— IIRC I complained about it when it was written.

  3. laanwj commented at 1:51 PM on February 17, 2012: member

    I'm not sure the conversion should even be there. Wouldn't it be better to move it with the rest of the URL parsing in GUIUtil? (so that bitcoin:// also can be tested by the unit case).

  4. laanwj commented at 1:59 PM on February 17, 2012: member

    When using QString you could easily get rid of the complete ugly loop:

    if(url.startsWith("bitcoin://"))
    {
        url.replace(0, 10, "bitcoin:");
    }
    

    Edit: working on this, expect pull request soon...

  5. laanwj referenced this in commit 070a8dee2f on Feb 17, 2012
  6. laanwj referenced this in commit 23b3cf9d10 on Feb 17, 2012
  7. laanwj commented at 5:53 PM on February 17, 2012: member

    Fixed in pull request #854

  8. laanwj closed this on Feb 17, 2012

  9. TheBlueMatt referenced this in commit 328512876a on Feb 18, 2012
  10. sje397 referenced this in commit 6066db9a61 on Feb 28, 2012
  11. coblee referenced this in commit b1a0a1657e on Jul 17, 2012
  12. coblee referenced this in commit d7acd5181d on Jul 17, 2012
  13. ptschip referenced this in commit c5511554e4 on Dec 5, 2017
  14. dexX7 referenced this in commit d39668d9f6 on Jan 28, 2019
  15. sipa referenced this in commit 77ccaf5cb9 on Apr 2, 2021
  16. sipa referenced this in commit cb8f70f488 on Apr 2, 2021
  17. sipa referenced this in commit a110aca93f on Apr 2, 2021
  18. sipa referenced this in commit bdca9bcb6c on Apr 23, 2021
  19. rebroad referenced this in commit 6e13b4e771 on Jun 23, 2021
  20. DrahtBot locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-29 03:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me