Correct the PUSHDATA4 minimal encoding test in script_invalid.json. #6074

pull davecgh wants to merge 1 commits into bitcoin:master from davecgh:correct_pushdata4_test changing 1 files +1 −1
  1. davecgh commented at 2:49 AM on April 28, 2015: contributor

    The test which is intended to prove that the script engine is properly rejecting non-minimally encoded PUSHDATA4 data is using the wrong opcode and value. The test is using 0x4f, which is OP_1NEGATE instead of the desired 0x4e, which is OP_PUSHDATA4. Further, the push of data is intended to be 256 bytes, but the value the test is using is 0x00100000 (4096), instead of the desired 0x00010000 (256).

    This pull request fixes both issues.

    This was found while examining the branch coverage in btcd against only these tests to help find missing branch coverage.

  2. Correct the PUSHDATA4 minimal encoding test.
    The test which is intended to prove that the script engine is properly
    rejecting non-minimally encoded PUSHDATA4 data is using the wrong
    opcode and value.  The test is using 0x4f, which is OP_1NEGATE instead
    of the desired 0x4e, which is OP_PUSHDATA4.  Further, the push of data
    is intended to be 256 bytes, but the value the test is using is
    0x00100000 (4096), instead of the desired 0x00010000 (256).
    
    This commit fixes both issues.
    
    This was found while examining the branch coverage in btcd against only
    these tests to help find missing branch coverage.
    d8f4cc328e
  3. davecgh force-pushed on Apr 28, 2015
  4. davecgh renamed this:
    Correct the PUSHDATA4 minimal encoding test.
    Correct the PUSHDATA4 minimal encoding test in script_invalid.json.
    on Apr 28, 2015
  5. sipa commented at 2:04 PM on April 28, 2015: member

    ACK, nice catch.

  6. laanwj added the label Tests on Apr 29, 2015
  7. laanwj merged this on Apr 29, 2015
  8. laanwj closed this on Apr 29, 2015

  9. laanwj referenced this in commit 948beaf190 on Apr 29, 2015
  10. davecgh deleted the branch on Apr 29, 2015
  11. MarcoFalke locked this on Sep 8, 2021
Contributors
Labels

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-26 12:15 UTC

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