reticulatedpines / magiclantern_simplified

A Git based version of Magic Lantern, for those unwilling or unable to work using Mercurial. The vast majority of branches have been removed, with those thought to be important brought in individually and merged.
GNU General Public License v2.0
142 stars 47 forks source link

init.c: my_assert_handler: add 'nullptr' default message, if nullpointer is passed #99

Closed coon42 closed 1 year ago

coon42 commented 1 year ago

This PR fixes an issue on RP firmware (and probably also other firmwares), where many Debug_Assert calls are done in a wrong way (canon bug).

Usually the first argument is used as an error description and is assumed being a string. For some reason, many locations of RPs firmware call it using a null pointer which makes the assert handler crash again resulting into less context info being shown on UART. The fix replaces the null pointer by the string "nullptr" in our crash handler before calling canon original handler to avoid the crash in the crash handler.