BelledonneCommunications / linphone-desktop

Linphone is a free VoIP and video softphone based on the SIP protocol. Mirror of git://git.linphone.org/linphone-desktop.git
https://linphone.org/
GNU General Public License v3.0
393 stars 201 forks source link

[Bug]: Linphone v5 crashes due to special characters in sip uri #731

Open maxgisel opened 1 year ago

maxgisel commented 1 year ago

Context

We are using Linphone in our company with own SIP service.

General information

Expected behaviour

Desktop app v5.0.4 does not launch, crashes during launch. Desktop app v5 should launch normally like v4 did with same db contents.

To Reproduce

  1. Linphone 5.0.4
  2. Quotation marks (") or German umlauts (ä, ö, ü, ß) in column "value" in table "sip_address" in file linphone.db

Additional context

It seems like there is a critical bug in Linphone (at least windows desktop variant) which prevents Linphone from starting after updating from version 4.x to version 5.0.4. Linphone crashes. Please find logs at the bottom.

In the database linphone.db in the table “sip_address” and there in the column “value” there are entries existing from version 4, which look like this:

sip:<number>@<domain>;x-sipx-cid-display="Max+Müller";x-sipx-cid-user=<number>

If special characters like quotation marks (") or German umlauts (ä, ö, ü, ß) are contained in this column, Linphone v5 crashes during startup. If you remove these special characters Linphone v5 can start successfully. In version 4 this also worked with these special characters. This leads me to believe that there is a bug in version 5.

[…]

2023-01-05 13:01:49:054 [/liblinphone] MESSAGE Start measurement of [Get call history.].
2023-01-05 13:01:49:055 [/belle-sip] MESSAGE [org.antlr.runtime.EarlyExitException]  reason [Unexpected token]
2023-01-05 13:01:49:055 [/belle-sip] ERROR fast_header_address parser error for [sip:<number>@<domain>;x-sipx-cid-display="Max+Müller";x-sipx-cid-user=<number>]
2023-01-05 13:01:49:055 [/liblinphone] WARNING Cannot create Address, bad uri [sip:<number>@<domain>;x-sipx-cid-display="Max+Müller";x-sipx-cid-user=<number>]
2023-01-05 13:01:49:420 [/bctbx] ERROR _signal_hook:  General Fault: '11'! 

Callstack: 
0x7ffa35f12350: bctbx_file_sync(ffffffff) in bctoolbox.dll
0x7ffa35f1210d: bctbx_file_sync(ffffffff) in bctoolbox.dll
0x7ffa6bf60ef5: seh_filter_exe(ffffffff) in ucrtbase.dll
0x7ff78af03df0: PluginNetworkHelper::qt_static_metacall(ffffffff) in linphone.exe
0x7ffa525decd0: _C_specific_handler(ffffffff) in VCRUNTIME140.dll
0x7ffa6e67241f: _chkstk(ffffffff) in ntdll.dll
0x7ffa6e6214a4: RtlRaiseException(ffffffff) in ntdll.dll
0x7ffa6e670f4e: KiUserExceptionDispatcher(ffffffff) in ntdll.dll
0x7ff998e51142: LinphonePrivate::ClonableObject::~ClonableObject(ffffffff) in liblinphone.dll
0x7ff998fef2da: LinphonePrivate::ClonableObject::~ClonableObject(ffffffff) in liblinphone.dll
0x7ff998fbbcaf: LinphonePrivate::ClonableObject::~ClonableObject(ffffffff) in liblinphone.dll
0x7ff998fb1fbd: LinphonePrivate::ClonableObject::~ClonableObject(ffffffff) in liblinphone.dll
0x7ff998fa9e73: LinphonePrivate::ClonableObject::~ClonableObject(ffffffff) in liblinphone.dll
0x7ff998fd68dc: LinphonePrivate::ClonableObject::~ClonableObject(ffffffff) in liblinphone.dll
0x7ff998e574bd: LinphonePrivate::ClonableObject::~ClonableObject(ffffffff) in liblinphone.dll
0x7ff9cdcf8f53: linphone::Transports::setUdpPort(ffffffff) in liblinphone++.dll
0x7ff78ae4921b: PluginNetworkHelper::qt_static_metacall(ffffffff) in linphone.exe
0x7ff78ae48f3a: PluginNetworkHelper::qt_static_metacall(ffffffff) in linphone.exe
0x7ff78ae41a95: PluginNetworkHelper::qt_static_metacall(ffffffff) in linphone.exe
0x7ff78adccfdf: PluginNetworkHelper::qt_static_metacall(ffffffff) in linphone.exe
0x7ff96619ac34: QMetaCallEvent::placeMetaCall(ffffffff) in Qt5Core.dll
0x7ff9661995c1: QObject::event(ffffffff) in Qt5Core.dll
0x7ff96add4990: QApplicationPrivate::notify_helper(ffffffff) in Qt5Widgets.dll
0x7ff96add3a13: QApplication::notify(ffffffff) in Qt5Widgets.dll
0x7ff966172aca: QCoreApplication::notifyInternal2(ffffffff) in Qt5Core.dll
0x7ff966174845: QCoreApplicationPrivate::sendPostedEvents(ffffffff) in Qt5Core.dll
0x7ff975de2dff: qt_plugin_query_metadata(ffffffff) in qwindows.dll
0x7ff9661bba5a: QEventDispatcherWin32::processEvents(ffffffff) in Qt5Core.dll
0x7ff975de2dd9: qt_plugin_query_metadata(ffffffff) in qwindows.dll
0x7ff96616ef2c: QEventLoop::exec(ffffffff) in Qt5Core.dll
0x7ff966171a94: QCoreApplication::exec(ffffffff) in Qt5Core.dll
0x7ff78ad0c03e: PluginNetworkHelper::qt_static_metacall(ffffffff) in linphone.exe
0x7ff78aeb4f67: PluginNetworkHelper::qt_static_metacall(ffffffff) in linphone.exe
0x7ff78aeb3c2e: PluginNetworkHelper::qt_static_metacall(ffffffff) in linphone.exe
0x7ffa6ca87614: BaseThreadInitThunk(ffffffff) in KERNEL32.DLL
0x7ffa6e6226a1: RtlUserThreadStart(ffffffff) in ntdll.dll

2023-01-05 13:01:49:627 [/bctbx] ERROR _signal_hook:  General Fault: '22'! 

Callstack: 
0x7ffa35f12350: bctbx_file_sync(ffffffff) in bctoolbox.dll
0x7ffa35f126f3: bctbx_file_sync(ffffffff) in bctoolbox.dll
0x7ffa6c230327: UnhandledExceptionFilter(ffffffff) in KERNELBASE.dll
0x7ffa6e675530: memset(ffffffff) in ntdll.dll
0x7ffa6e65c876: __C_specific_handler(ffffffff) in ntdll.dll
0x7ffa6e67241f: __chkstk(ffffffff) in ntdll.dll
0x7ffa6e6214a4: RtlRaiseException(ffffffff) in ntdll.dll
0x7ffa6e670f4e: KiUserExceptionDispatcher(ffffffff) in ntdll.dll
0x7ff998e51142: ??1ClonableObject@LinphonePrivate@@UEAA@XZ(ffffffff) in liblinphone.dll
0x7ff998fef2da: ??1ClonableObject@LinphonePrivate@@UEAA@XZ(ffffffff) in liblinphone.dll
0x7ff998fbbcaf: ??1ClonableObject@LinphonePrivate@@UEAA@XZ(ffffffff) in liblinphone.dll
0x7ff998fb1fbd: ??1ClonableObject@LinphonePrivate@@UEAA@XZ(ffffffff) in liblinphone.dll
0x7ff998fa9e73: ??1ClonableObject@LinphonePrivate@@UEAA@XZ(ffffffff) in liblinphone.dll
0x7ff998fd68dc: ??1ClonableObject@LinphonePrivate@@UEAA@XZ(ffffffff) in liblinphone.dll
0x7ff998e574bd: ??1ClonableObject@LinphonePrivate@@UEAA@XZ(ffffffff) in liblinphone.dll
0x7ff9cdcf8f53: ?setUdpPort@Transports@linphone@@QEAAXH@Z(ffffffff) in liblinphone++.dll
0x7ff78ae4921b: ?qt_static_metacall@PluginNetworkHelper@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z(ffffffff) in linphone.exe
0x7ff78ae48f3a: ?qt_static_metacall@PluginNetworkHelper@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z(ffffffff) in linphone.exe
0x7ff78ae41a95: ?qt_static_metacall@PluginNetworkHelper@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z(ffffffff) in linphone.exe
0x7ff78adccfdf: ?qt_static_metacall@PluginNetworkHelper@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z(ffffffff) in linphone.exe
0x7ff96619ac34: ?placeMetaCall@QMetaCallEvent@@UEAAXPEAVQObject@@@Z(ffffffff) in Qt5Core.dll
0x7ff9661995c1: ?event@QObject@@UEAA_NPEAVQEvent@@@Z(ffffffff) in Qt5Core.dll
0x7ff96add4990: ?notify_helper@QApplicationPrivate@@QEAA_NPEAVQObject@@PEAVQEvent@@@Z(ffffffff) in Qt5Widgets.dll
0x7ff96add3a13: ?notify@QApplication@@UEAA_NPEAVQObject@@PEAVQEvent@@@Z(ffffffff) in Qt5Widgets.dll
0x7ff966172aca: ?notifyInternal2@QCoreApplication@@CA_NPEAVQObject@@PEAVQEvent@@@Z(ffffffff) in Qt5Core.dll
0x7ff966174845: ?sendPostedEvents@QCoreApplicationPrivate@@SAXPEAVQObject@@HPEAVQThreadData@@@Z(ffffffff) in Qt5Core.dll
0x7ff975de2dff: qt_plugin_query_metadata(ffffffff) in qwindows.dll
0x7ff9661bba5a: ?processEvents@QEventDispatcherWin32@@UEAA_NV?$QFlags@W4ProcessEventsFlag@QEventLoop@@@@@Z(ffffffff) in Qt5Core.dll
0x7ff975de2dd9: qt_plugin_query_metadata(ffffffff) in qwindows.dll
0x7ff96616ef2c: ?exec@QEventLoop@@QEAAHV?$QFlags@W4ProcessEventsFlag@QEventLoop@@@@@Z(ffffffff) in Qt5Core.dll
0x7ff966171a94: ?exec@QCoreApplication@@SAHXZ(ffffffff) in Qt5Core.dll
0x7ff78ad0c03e: ?qt_static_metacall@PluginNetworkHelper@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z(ffffffff) in linphone.exe
0x7ff78aeb4f67: ?qt_static_metacall@PluginNetworkHelper@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z(ffffffff) in linphone.exe
0x7ff78aeb3c2e: ?qt_static_metacall@PluginNetworkHelper@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z(ffffffff) in linphone.exe
0x7ffa6ca87614: BaseThreadInitThunk(ffffffff) in KERNEL32.DLL
0x7ffa6e6226a1: RtlUserThreadStart(ffffffff) in ntdll.dll

SDK logs URL

No response

julonexus commented 1 year ago

Hi Having a crash will be fixed but the bug doesn't come from v5 but from v4. As per RFC : https://www.rfc-editor.org/rfc/rfc2396#section-2.4.3 these characters must be escaped . They should not be stored in DB in raw. That's the bug. In v5, this kind of URI will be not used because of malformation.