From: kosmirror <kos...@us...> - 2025-06-18 20:33:34
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via af47450125b252204d3a9af3a76c837cca281ed1 (commit) from c01e1b0511e107bd3d3c22a7facdc4ddc85ecbd4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit af47450125b252204d3a9af3a76c837cca281ed1 Author: Falco Girgis <gyr...@gm...> Date: Tue Jun 17 13:45:38 2025 -0500 Fixed maple crash when unknown device attached. Currently, the Maple driver crashes due to NULL pointer dereference in "maple_driver.c" on line 121. When the user manually disables certain Maple drivers via explicitly providing a custom KOS_INIT_FLAGS() list, and such a device is plugged into the controller, the "dev" pointer never gets allocated, since a driver for it is never found. 1) Check to see if dev is NULL and error out early before dereferencing it. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/maple/maple_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/arch/dreamcast/hardware/maple/maple_driver.c b/kernel/arch/dreamcast/hardware/maple/maple_driver.c index e747c462..00b9ba0b 100644 --- a/kernel/arch/dreamcast/hardware/maple/maple_driver.c +++ b/kernel/arch/dreamcast/hardware/maple/maple_driver.c @@ -116,6 +116,9 @@ int maple_driver_attach(maple_frame_t *det) { } } + if(!dev) + return -1; + /* Did we get any hits? */ if(!attached) { free(dev->status); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |