command ```./swftophp poc-5```


```
==22762==ERROR: AddressSanitizer: SEGV on unknown address 0x000000001000 (pc 0x000000504eaf bp 0x7ffcd7c86d30 sp 0x7ffcd7c86d20 T0)
==22762==The signal is caused by a READ memory access.
    #0 0x504eaf in getString /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:355:22
    #1 0x5072cc in decompile5Action /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:3433:25
    #2 0x4f5c90 in outputSWF_DOACTION /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/outputscript.c:1548:29
    #3 0x4f88cd in outputBlock /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/outputscript.c:2079:4
    #4 0x4fbfa9 in readMovie /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:277:4
    #5 0x4fb633 in main /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:350:2
    #6 0x7f718d52cc86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
    #7 0x41cce9 in _start (/home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/swftophp+0x41cce9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:355:22 in getString
==22762==ABORTING
eval@ubuntu:~/Desktop/libming-CVE-2018-8962/obj-aflgo/util$ ./swftophp ~/Desktop/new\ bugs-20230720T213102Z-001/new\ bugs/libming/id_000293\,25659455\,sig_11\,src_002824\,op_arith8\,pos_237\,val_-4.swf 
header indicates a filesize of 761 but filesize is 460
<?php
$m = new SWFMovie(0);

ming_setscale(1.0);
$m->setRate(94.402344);
$m->setDimension(-84323, 75030);

/* Note: xMin and/or yMin are not 0! */

$m->setFrames(22936);
/*Unknown block type 197*/
/*Unknown block type 632*/
/*Unknown block type 111*/
/*Unknown block type 986*/

/* SWF_DOACTION */
$m->add(new SWFAction("") );

/* SWF_DOACTION */
=================================================================
==22781==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x615000000030 at pc 0x0000005054d3 bp 0x7ffe847d3c60 sp 0x7ffe847d3c58
READ of size 1 at 0x615000000030 thread T0
    #0 0x5054d2 in OpCode /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:868:37
    #1 0x4fe9f2 in decompileINCR_DECR /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:1444:14
    #2 0x4fd2e0 in decompileAction /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:3222:10
    #3 0x50470c in decompileActions /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:3401:6
    #4 0x507223 in decompile5Action /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:3423:2
    #5 0x4f5c90 in outputSWF_DOACTION /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/outputscript.c:1548:29
    #6 0x4f88cd in outputBlock /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/outputscript.c:2079:4
    #7 0x4fbfa9 in readMovie /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:277:4
    #8 0x4fb633 in main /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:350:2
    #9 0x7f37908d4c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
    #10 0x41cce9 in _start (/home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/swftophp+0x41cce9)

0x615000000030 is located 80 bytes to the left of 480-byte region [0x615000000080,0x615000000260)
allocated by thread T0 here:
    #0 0x4ad6e8 in realloc /home/eval/build/llvm_tools/llvm-11.0.0.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:164
    #1 0x518df4 in parseSWF_DOACTION /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/parser.c:2435:43
    #2 0x4fc2b0 in blockParse /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/blocktypes.c:145:14
    #3 0x4fbf39 in readMovie /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:265:11
    #4 0x4fb633 in main /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:350:2
    #5 0x7f37908d4c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:868:37 in OpCode
Shadow bytes around the buggy address:
  0x0c2a7fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c2a7fff8000: fa fa fa fa fa fa[fa]fa fa fa fa fa fa fa fa fa
  0x0c2a7fff8010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff8020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff8030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff8040: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
  0x0c2a7fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==22781==ABORTING
```
[poc-5.zip](https://github.com/libming/libming/files/12116094/poc-5.zip)

heap-buffer-overflow in OpCode
This is a GitHub Issue
repo:libming
owner:libming
Title : heap-buffer-overflow in OpCode
Issue date:

--- start body ---
command ```./swftophp poc-5```


```
==22762==ERROR: AddressSanitizer: SEGV on unknown address 0x000000001000 (pc 0x000000504eaf bp 0x7ffcd7c86d30 sp 0x7ffcd7c86d20 T0)
==22762==The signal is caused by a READ memory access.
    #0 0x504eaf in getString /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:355:22
    #1 0x5072cc in decompile5Action /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:3433:25
    #2 0x4f5c90 in outputSWF_DOACTION /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/outputscript.c:1548:29
    #3 0x4f88cd in outputBlock /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/outputscript.c:2079:4
    #4 0x4fbfa9 in readMovie /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:277:4
    #5 0x4fb633 in main /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:350:2
    #6 0x7f718d52cc86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
    #7 0x41cce9 in _start (/home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/swftophp+0x41cce9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:355:22 in getString
==22762==ABORTING
eval@ubuntu:~/Desktop/libming-CVE-2018-8962/obj-aflgo/util$ ./swftophp ~/Desktop/new\ bugs-20230720T213102Z-001/new\ bugs/libming/id_000293\,25659455\,sig_11\,src_002824\,op_arith8\,pos_237\,val_-4.swf 
header indicates a filesize of 761 but filesize is 460
<?php
$m = new SWFMovie(0);

ming_setscale(1.0);
$m->setRate(94.402344);
$m->setDimension(-84323, 75030);

/* Note: xMin and/or yMin are not 0! */

$m->setFrames(22936);
/*Unknown block type 197*/
/*Unknown block type 632*/
/*Unknown block type 111*/
/*Unknown block type 986*/

/* SWF_DOACTION */
$m->add(new SWFAction("") );

/* SWF_DOACTION */
=================================================================
==22781==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x615000000030 at pc 0x0000005054d3 bp 0x7ffe847d3c60 sp 0x7ffe847d3c58
READ of size 1 at 0x615000000030 thread T0
    #0 0x5054d2 in OpCode /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:868:37
    #1 0x4fe9f2 in decompileINCR_DECR /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:1444:14
    #2 0x4fd2e0 in decompileAction /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:3222:10
    #3 0x50470c in decompileActions /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:3401:6
    #4 0x507223 in decompile5Action /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:3423:2
    #5 0x4f5c90 in outputSWF_DOACTION /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/outputscript.c:1548:29
    #6 0x4f88cd in outputBlock /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/outputscript.c:2079:4
    #7 0x4fbfa9 in readMovie /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:277:4
    #8 0x4fb633 in main /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:350:2
    #9 0x7f37908d4c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
    #10 0x41cce9 in _start (/home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/swftophp+0x41cce9)

0x615000000030 is located 80 bytes to the left of 480-byte region [0x615000000080,0x615000000260)
allocated by thread T0 here:
    #0 0x4ad6e8 in realloc /home/eval/build/llvm_tools/llvm-11.0.0.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:164
    #1 0x518df4 in parseSWF_DOACTION /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/parser.c:2435:43
    #2 0x4fc2b0 in blockParse /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/blocktypes.c:145:14
    #3 0x4fbf39 in readMovie /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:265:11
    #4 0x4fb633 in main /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/main.c:350:2
    #5 0x7f37908d4c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/eval/Desktop/libming-CVE-2018-8962/obj-aflgo/util/../../util/decompile.c:868:37 in OpCode
Shadow bytes around the buggy address:
  0x0c2a7fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c2a7fff8000: fa fa fa fa fa fa[fa]fa fa fa fa fa fa fa fa fa
  0x0c2a7fff8010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff8020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff8030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fff8040: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
  0x0c2a7fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==22781==ABORTING
```
[poc-5.zip](https://github.com/libming/libming/files/12116094/poc-5.zip)

--- end body ---
