Skip to content

Fix: PLY heap buffer overflow - #5310

Merged
kimkulling merged 3 commits into
assimp:masterfrom
aavenel:fix/PLYHeapBufferOverflow
Nov 20, 2023
Merged

kimkulling merged 3 commits into
assimp:masterfrom
aavenel:fix/PLYHeapBufferOverflow

Conversation

@aavenel

@aavenel aavenel commented Nov 4, 2023

Copy link
Copy Markdown
Contributor

Fix a heap buffer overflow happening while loading malformed ply.

==23896==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x12f9daec1827 at pc 0x7ffcad83699c bp 0x00c61574c910 sp 0x00c61574c910
READ of size 1 at 0x12f9daec1827 thread T0
==23896==WARNING: Failed to use and restart external symbolizer!
    #0 0x7ffcad83699b in Assimp::IOStreamBuffer<char>::getNextLine C:\Users\aavenel\Dev\assimp\include\assimp\IOStreamBuffer.h:299
    https://github.com/assimp/assimp/pull/1 0x7ffcad83ce69 in Assimp::PLY::DOM::ParseHeader C:\Users\aavenel\Dev\assimp\code\AssetLib\Ply\PlyParser.cpp:428
    https://github.com/assimp/assimp/pull/2 0x7ffcad83d58e in Assimp::PLY::DOM::ParseInstanceBinary C:\Users\aavenel\Dev\assimp\code\AssetLib\Ply\PlyParser.cpp:498
    https://github.com/assimp/assimp/pull/3 0x7ffcad83302a in Assimp::PLYImporter::InternReadFile C:\Users\aavenel\Dev\assimp\code\AssetLib\Ply\PlyLoader.cpp:189
    https://github.com/assimp/assimp/pull/4 0x7ffcad4f2f48 in Assimp::BaseImporter::ReadFile C:\Users\aavenel\Dev\assimp\code\Common\BaseImporter.cpp:135
    https://github.com/assimp/assimp/pull/5 0x7ffcad51ee46 in Assimp::Importer::ReadFile C:\Users\aavenel\Dev\assimp\code\Common\Importer.cpp:709
    https://github.com/assimp/assimp/pull/6 0x7ff7dd8f9f1a in ImportModel C:\Users\aavenel\Dev\assimp\tools\assimp_cmd\Main.cpp:307
    https://github.com/assimp/assimp/pull/7 0x7ff7dd8fdf9e in Assimp_Info C:\Users\aavenel\Dev\assimp\tools\assimp_cmd\Info.cpp:344
    https://github.com/assimp/assimp/pull/8 0x7ff7dd8fc04f in main C:\Users\aavenel\Dev\assimp\tools\assimp_cmd\Main.cpp:222
    https://github.com/assimp/assimp/pull/9 0x7ff7dd9030eb in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
    https://github.com/assimp/assimp/pull/10 0x7ffd39e57343 in BaseThreadInitThunk+0x13 (C:\WINDOWS\System32\KERNEL32.DLL+0x180017343)
    https://github.com/assimp/assimp/pull/11 0x7ffd3a2626b0 in RtlUserThreadStart+0x20 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x1800526b0)

Alexandre Avenel added 2 commits November 4, 2023 10:09
==23896==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x12f9daec1827 at pc 0x7ffcad83699c bp 0x00c61574c910 sp 0x00c61574c910
READ of size 1 at 0x12f9daec1827 thread T0
==23896==WARNING: Failed to use and restart external symbolizer!
    #0 0x7ffcad83699b in Assimp::IOStreamBuffer<char>::getNextLine C:\Users\aavenel\Dev\assimp\include\assimp\IOStreamBuffer.h:299
    assimp#1 0x7ffcad83ce69 in Assimp::PLY::DOM::ParseHeader C:\Users\aavenel\Dev\assimp\code\AssetLib\Ply\PlyParser.cpp:428
    assimp#2 0x7ffcad83d58e in Assimp::PLY::DOM::ParseInstanceBinary C:\Users\aavenel\Dev\assimp\code\AssetLib\Ply\PlyParser.cpp:498
    assimp#3 0x7ffcad83302a in Assimp::PLYImporter::InternReadFile C:\Users\aavenel\Dev\assimp\code\AssetLib\Ply\PlyLoader.cpp:189
    assimp#4 0x7ffcad4f2f48 in Assimp::BaseImporter::ReadFile C:\Users\aavenel\Dev\assimp\code\Common\BaseImporter.cpp:135
    assimp#5 0x7ffcad51ee46 in Assimp::Importer::ReadFile C:\Users\aavenel\Dev\assimp\code\Common\Importer.cpp:709
    assimp#6 0x7ff7dd8f9f1a in ImportModel C:\Users\aavenel\Dev\assimp\tools\assimp_cmd\Main.cpp:307
    assimp#7 0x7ff7dd8fdf9e in Assimp_Info C:\Users\aavenel\Dev\assimp\tools\assimp_cmd\Info.cpp:344
    assimp#8 0x7ff7dd8fc04f in main C:\Users\aavenel\Dev\assimp\tools\assimp_cmd\Main.cpp:222
    assimp#9 0x7ff7dd9030eb in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
    assimp#10 0x7ffd39e57343 in BaseThreadInitThunk+0x13 (C:\WINDOWS\System32\KERNEL32.DLL+0x180017343)
    assimp#11 0x7ffd3a2626b0 in RtlUserThreadStart+0x20 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x1800526b0)

@kimkulling kimkulling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks a lot for the PR. Looks fine.

@kimkulling
kimkulling merged commit e4e2c63 into assimp:master Nov 20, 2023
@kimkulling

Copy link
Copy Markdown
Member

Merged, thanks a lot for your contribution.

@aavenel
aavenel deleted the fix/PLYHeapBufferOverflow branch November 20, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants