mirror of https://github.com/PCSX2/pcsx2.git
pcsx2: prevent a potential null deference
CID 146889 (#1 of 1): Dereference null return value (NULL_RETURNS)4. dereference: Dereferencing a pointer that might be null wxGetApp()->GetDisassemblyPtr() when calling update FindWindowById returns NULL if the Window with the given id is not found, no need to do a extra check for validation of the id. also do a check for wxGetApp()->GetDisassemblyPtr() to prevent a null deference.
This commit is contained in:
parent
04b765a674
commit
b8caab5f3d
|
@ -392,6 +392,7 @@ void CBreakPoints::Update(u32 addr)
|
|||
|
||||
if (resume)
|
||||
r5900Debug.resumeCpu();
|
||||
|
||||
wxGetApp().GetDisassemblyPtr()->update();
|
||||
auto disassembly_window = wxGetApp().GetDisassemblyPtr();
|
||||
if (disassembly_window) // make sure that valid pointer is recieved to prevent potential NULL dereference.
|
||||
disassembly_window->update();
|
||||
}
|
||||
|
|
|
@ -514,7 +514,7 @@ public:
|
|||
|
||||
GSFrame* GetGsFramePtr() const { return (GSFrame*)wxWindow::FindWindowById( m_id_GsFrame ); }
|
||||
MainEmuFrame* GetMainFramePtr() const { return (MainEmuFrame*)wxWindow::FindWindowById( m_id_MainFrame ); }
|
||||
DisassemblyDialog* GetDisassemblyPtr() const { return m_id_Disassembler ? (DisassemblyDialog*)wxWindow::FindWindowById( m_id_Disassembler ) : NULL; }
|
||||
DisassemblyDialog* GetDisassemblyPtr() const { return (DisassemblyDialog*)wxWindow::FindWindowById(m_id_Disassembler); }
|
||||
|
||||
void enterDebugMode();
|
||||
void leaveDebugMode();
|
||||
|
|
Loading…
Reference in New Issue