forked from osmocom/wireshark
Qt: Fix segfault when some ICU codec is not available
$ gdb --args wireshark (gdb) run Starting program: /usr/bin/wireshark [New LWP 10363] [New LWP 10364] ** (wireshark:10356) 13:13:14.137941 [GUI WARNING] -- codecForName: ucnv_open failed ISO-8859-2 U_FILE_ACCESS_ERROR (gdb) bt Thread 1 "wireshark" received signal SIGSEGV, Segmentation fault. 0x00005555557b1959 in MainWindow::findTextCodecs (this=0x7fffecdfd390) at wireshark-3.6.5/ui/qt/main_window.cpp:2029 2029 QString key = codec->name().toUpper(); (gdb) bt #0 0x00005555557b1959 in MainWindow::findTextCodecs (this=0x7fffecdfd390) at wireshark-3.6.5/ui/qt/main_window.cpp:2029 #1 0x00005555557b4ce3 in MainWindow::MainWindow (this=this@entry=0x7fffecdfd390, parent=parent@entry=0x0) at wireshark-3.6.5/ui/qt/main_window.cpp:362 #2 0x000055555564f0af in main (argc=<optimized out>, qt_argv=0x7fffffffe748) at wireshark-3.6.5/ui/qt/main.cpp:725 See https://gitlab.alpinelinux.org/alpine/aports/-/issues/13814 for more information. Conflicts (cherry-picked from 635286ce): ui/qt/main_window.cpp
This commit is contained in:
parent
fe4210029a
commit
3187fbbd61
|
@ -2036,6 +2036,13 @@ void LogwolfMainWindow::findTextCodecs() {
|
||||||
QRegularExpressionMatch match;
|
QRegularExpressionMatch match;
|
||||||
for (int mib : mibs) {
|
for (int mib : mibs) {
|
||||||
QTextCodec *codec = QTextCodec::codecForMib(mib);
|
QTextCodec *codec = QTextCodec::codecForMib(mib);
|
||||||
|
// QTextCodec::availableMibs() returns a list of hard-coded MIB
|
||||||
|
// numbers, it doesn't check if they are really available. ICU data may
|
||||||
|
// not have been compiled with support for all encodings.
|
||||||
|
if (!codec) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
QString key = codec->name().toUpper();
|
QString key = codec->name().toUpper();
|
||||||
char rank;
|
char rank;
|
||||||
|
|
||||||
|
|
|
@ -2067,6 +2067,13 @@ void WiresharkMainWindow::findTextCodecs() {
|
||||||
QRegularExpressionMatch match;
|
QRegularExpressionMatch match;
|
||||||
for (int mib : mibs) {
|
for (int mib : mibs) {
|
||||||
QTextCodec *codec = QTextCodec::codecForMib(mib);
|
QTextCodec *codec = QTextCodec::codecForMib(mib);
|
||||||
|
// QTextCodec::availableMibs() returns a list of hard-coded MIB
|
||||||
|
// numbers, it doesn't check if they are really available. ICU data may
|
||||||
|
// not have been compiled with support for all encodings.
|
||||||
|
if (!codec) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
QString key = codec->name().toUpper();
|
QString key = codec->name().toUpper();
|
||||||
char rank;
|
char rank;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue