octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63437] Null pointer dereference in file-edito


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #63437] Null pointer dereference in file-editor-tab.cc
Date: Mon, 28 Nov 2022 23:26:36 -0500 (EST)

Follow-up Comment #1, bug #63437 (project octave):

I don't think we want to use error_unless for this kind of problem in the GUI.
 If NDEBUG is defined, it will be treated as a no-op, and any error it
generates requires that the GUI is functional enough to display messages in
the command window.  

Instead, I think we should be using a QMessageBox for these kinds of errors in
the GUI.  And if this kind of check needs to happen frequently, then we should
fix the resource manager's "get_settings" function to ensure that it will
either return a valid pointer or handle the error itself?  Or maybe there is a
better way to retrieve settings using signal/slot connections?

I'm wondering whether it is possible that this code (or something similar)
could be the reason that people report that Octave no longer starts for them? 
If Octave is trying to reload a file editor tab at startup and something goes
wrong with accessing the settings in this constructor, Octave could crash with
no useful error message displayed.

Also, as a minor point of style, we generally prefer to write "if (ptr)"
instead of "if (ptr != nullptr)".


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63437>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]