[Issue 22849] New: Global buffer overflow on lexer, dereferencing 4 bytes at the same time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 5 17:05:49 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22849

          Issue ID: 22849
           Summary: Global buffer overflow on lexer, dereferencing 4 bytes
                    at the same time
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: contact at lsferreira.net

A global buffer overflow happens on lexer.d:265 after dereferencing more memory
than available, according to AddressSanitizer.

---

SUMMARY: AddressSanitizer: global-buffer-overflow
/home/luis/Workspace/Programming/Repos/collab/github/dlang/dmd/src/dmd/lexer.d:265:17
in _D3dmd5lexer5Lexer4scanMFNbPSQBb6tokens5TokenZv
Shadow bytes around the buggy address:
  0x0aadcb2a0e60: 00 00 00 02 f9 f9 f9 f9 00 00 00 00 00 00 00 01
  0x0aadcb2a0e70: f9 f9 f9 f9 00 00 00 02 f9 f9 f9 f9 00 05 f9 f9
  0x0aadcb2a0e80: 02 f9 f9 f9 00 00 00 01 f9 f9 f9 f9 00 00 00 00
  0x0aadcb2a0e90: 00 00 00 00 03 f9 f9 f9 f9 f9 f9 f9 00 00 02 f9
  0x0aadcb2a0ea0: f9 f9 f9 f9 00 00 00 00 00 00 00 04 f9 f9 f9 f9
=>0x0aadcb2a0eb0: 00 00 00[01]f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x0aadcb2a0ec0: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x0aadcb2a0ed0: 00 00 00 00 00 00 00 00 00 00 00 02 f9 f9 f9 f9
  0x0aadcb2a0ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07 f9
  0x0aadcb2a0ef0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x0aadcb2a0f00: 00 03 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9
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
==220221==ABORTING

--


More information about the Digitalmars-d-bugs mailing list