Benjamin-Dobell / Heimdall

Heimdall is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung Galaxy devices.
MIT License
2.62k stars 587 forks source link

Flashing to an unknown partition causes a crash #536

Open goeranu opened 8 months ago

goeranu commented 8 months ago

When installing LineageOS recently, I used heimdall in place of the Windows Odin package used in the description from LineageOS. Googling I found a hit where the partition number was used to identify where to write the recovery image. Actually doing that though, resulted in heimdall crashing.

Looking at the problem afterwards using gdb I realise this is in the function flashPartition where the code first assigns part from pitData->FindEntry(it->argumentName), and then uses the value without checking if it was null. See the attached gdb session. It seems to me a check should be added to see if part is null, and if so write an error message rather than just crashing.

This was done on a Fedora 39 system with heimdall-2.0.2-3.fc39.x86_64. gdb-session.txt