Skip to content

fix search_sd returning an uninitialised pointer if empty SD MCB

On current lDOS, loading things into the HMA or UMA makes it so that only the DOS-internal UPBs and DPBs are allocated within the Low Memory Area MCB chain. (BIOCODE and DOSDATA are in front of the first MCB.) They already use lDOS style S MCBs however. Therefore, the devmark / SD MCB allocated in the LMA is empty.

Prior to this commit, the empty SD MCB would lead search_sd to not initialise its first_child pointer. This caused a crash at a later point after the caller stores the wild pointer.

Another pathological case seems to be an SD MCB with a single sub-MCB, where the sub-MCB's memory block is empty. This also causes a similar crash prior to this commit. This commit does cure that crash too but the sub-MCB then seems to not be listed correctly. May require another patch.

Merge request reports

Loading