lxqt / qtermwidget

The terminal widget for QTerminal
https://lxqt.github.io
GNU General Public License v2.0
485 stars 247 forks source link

Fixed comparison of pointer addition with NULL #549

Closed tsujan closed 2 months ago

tsujan commented 2 months ago

The comparison was added to fix a crash under Plasma-Wayland, when the terminal was split horizontally. Instead, a simple nullity check was enough.

The following compilation warning is also silenced:

qtermwidget/lib/TerminalCharacterDecoder.cpp:85:28: warning: comparing the result of pointer addition ‘(((const Konsole::Character*)characters) + ((sizetype)(((long unsigned int)i) * 16)))’ and NULL [-Waddress]
   85 |         if (characters + i == nullptr)
luis-pereira commented 2 months ago

I don't have Plasma installed to check it. That said, it seems Ok to me.

tsujan commented 2 months ago

I don't have Plasma installed to check it.

I tested it with kwin_wayland, and it prevented the crash that was reported at https://github.com/lxqt/qterminal/issues/806.

luis-pereira commented 2 months ago

I tested it with kwin_wayland, and it prevented the crash that was reported at lxqt/qterminal#806

Good. Didn't found any issue when not running without kwin_wayland.

tsujan commented 2 months ago

Didn't found any issue when not running without kwin_wayland.

Yes. For some reason unknown to us, it didn't happen in any Wayland compositor other than kwin_wayland — I'd checked with Weston, GNOME, LabWc and Wayfire.