summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2013-03-22 02:07:25 -0700
committerPatrick Ohly <patrick.ohly@intel.com>2013-04-22 16:01:44 +0200
commit1bd0d597034093bc7937900b1fe882c2f1401168 (patch)
tree0f45537c8838bd03aba396d33bc59fee80c2df00
parent7a1278dae1d8b4828d2bc2793a51aaa6a1f1cf10 (diff)
D-Bus server: avoid potential segfault
Klocwork warned about using a NULL starttime pointer in the case that the transport is unknown. Not sure whether this can actually happen at the moment, fix it anyway.
-rw-r--r--src/dbus/server/auto-sync-manager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dbus/server/auto-sync-manager.cpp b/src/dbus/server/auto-sync-manager.cpp
index c358e04a..6822267b 100644
--- a/src/dbus/server/auto-sync-manager.cpp
+++ b/src/dbus/server/auto-sync-manager.cpp
@@ -311,7 +311,7 @@ void AutoSyncManager::schedule(const std::string &reason)
SE_LOG_DEBUG(NULL, NULL, "auto sync: %s: ready to run via %s (transport present for %lds > %ds auto sync delay)",
configName.c_str(),
urlinfo.second.c_str(),
- (long)(*starttime - now).seconds(),
+ starttime ? (long)(*starttime - now).seconds() : -1,
task->m_delay);
readyURL = urlinfo.second;
break;