omerbenamram / mft

A parser for the MFT (Master File Table) format
Apache License 2.0
125 stars 18 forks source link

[BUGFIX] Infinit loop in the CSV output #117

Open abaghinyan opened 1 year ago

abaghinyan commented 1 year ago

Description:

Fixes an infinite loop and stack overflow error in CSV format output.

Details:

During the CSV format output, when the entry ID is the same as the entry ID of the grandparent, it causes an infinite loop that results in a stack overflow. This leads to the following error message:

Thread 'main' has overflowed its stack
Fatal runtime error: stack overflow
Aborted (core dumped)

Proposed Solution:

To fix this bug, I suggest utilizing a HashSet to store the entity IDs that have already been visited for a given entry. This will prevent the infinite loop.