Bug 22849 – Global buffer overflow on lexer, dereferencing 4 bytes at the same time

Status
NEW
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-03-05T17:05:49Z
Last change time
2024-12-13T19:21:19Z
Keywords
pull
Assigned to
No Owner
Creator
Luís Ferreira
Moved to GitHub: dmd#20064 →

Comments

Comment #0 by contact — 2022-03-05T17:05:49Z
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
Comment #1 by dlang-bot — 2022-03-05T17:08:20Z
@ljmf00 created dlang/dmd pull request #13766 "Fix issue 22849: Global buffer overflow on lexer dereferencing" fixing this issue: - Fix issue 22849: Global buffer overflow on lexer dereferencing Signed-off-by: Luís Ferreira <[email protected]> https://github.com/dlang/dmd/pull/13766
Comment #2 by robert.schadek — 2024-12-13T19:21:19Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20064 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB