summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-05 18:54:59 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-05 18:54:59 +0200
commit6468223986ede1b1b64581dd37fed11724788a2b (patch)
tree466281feac4b90f63809b114d8184cd5279210db
parent8d85ec4d3107c4c9868c12cc04fbc518e5fede17 (diff)
libs: validate protocol first before starting tracker
-rw-r--r--opentrack/selected-libraries.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/opentrack/selected-libraries.cpp b/opentrack/selected-libraries.cpp
index 8cb226c8..7617ce90 100644
--- a/opentrack/selected-libraries.cpp
+++ b/opentrack/selected-libraries.cpp
@@ -20,19 +20,27 @@ SelectedLibraries::SelectedLibraries(QFrame* frame, dylibptr t, dylibptr p, dyli
pProtocol(nullptr),
correct(false)
{
- pTracker = make_instance<ITracker>(t);
pProtocol = make_instance<IProtocol>(p);
- pFilter = make_instance<IFilter>(f);
- if (!pTracker || !pProtocol)
+ if (!pProtocol)
{
- qDebug() << "dylib load failure";
+ qDebug() << "protocol dylib load failure";
return;
}
if(!pProtocol->correct())
{
qDebug() << "protocol load failure";
+ pProtocol = nullptr;
+ return;
+ }
+
+ pTracker = make_instance<ITracker>(t);
+ pFilter = make_instance<IFilter>(f);
+
+ if (!pTracker)
+ {
+ qDebug() << "tracker dylib load failure";
return;
}