[vlc-commits] sparkle: Fix longstanding crash in automatic update search

David Fuhrmann git at videolan.org
Sat Aug 12 16:02:16 CEST 2017


vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Tue Aug 22 15:49:56 2017 +0200| [ae2567dbdfe7ee9a1eaaf7e6dcc5dbec5f45c68f] | committer: David Fuhrmann

sparkle: Fix longstanding crash in automatic update search

Our patch to sparkle introduced a crash during runtime, as key
and object was swapped and the key could not be copied.

The relevant code path was in SUBasicUpdateDriver.m ->
didFindValidUpdate, which crashed if it was called.
This code path is used in the following circumstances:
- The user configured sparkle to automatically download and
  install updates (this is an option you can change if an update is
  announced to the user).
- An update is actually available
- The automatic update check tries to search for an update and
  finds the update.

User behaviour:
- Update check is performed every 24h, which crash VLC once
  performed and update was found.
- Before the crash, last update check timestamp is saved still.
- VLC now works for 24 h without update related crash.
- If VLC is started after 24 h again, a new update check is performed
  and VLC crashes again.

fixes #18148

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=ae2567dbdfe7ee9a1eaaf7e6dcc5dbec5f45c68f
---

 contrib/src/sparkle/rules.mak                               |  1 -
 .../sparkle/sparkle-fix-compilation-on-snowleopard.patch    |  6 +++---
 .../sparkle-fix-runtime-exception-on-snowleopard.patch      | 13 -------------
 3 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/contrib/src/sparkle/rules.mak b/contrib/src/sparkle/rules.mak
index f4426674d0..7e045ed7b6 100644
--- a/contrib/src/sparkle/rules.mak
+++ b/contrib/src/sparkle/rules.mak
@@ -15,7 +15,6 @@ $(TARBALLS)/Sparkle-$(SPARKLE_VERSION).zip:
 sparkle: Sparkle-$(SPARKLE_VERSION).zip .sum-sparkle
 	$(UNPACK)
 	$(APPLY) $(SRC)/sparkle/sparkle-fix-compilation-on-snowleopard.patch
-	$(APPLY) $(SRC)/sparkle/sparkle-fix-runtime-exception-on-snowleopard.patch
 	$(APPLY) $(SRC)/sparkle/sparkle-disable-redirects-to-non-HTTP-URLs-in-release-notes.patch
 	$(APPLY) $(SRC)/sparkle/sparkle-prevent-inclusion-of-local-files-via-file-XML-entiti.patch
 	$(APPLY) $(SRC)/sparkle/sparkle-macosx106.patch
diff --git a/contrib/src/sparkle/sparkle-fix-compilation-on-snowleopard.patch b/contrib/src/sparkle/sparkle-fix-compilation-on-snowleopard.patch
index 828c3e96b2..955b8a7c02 100644
--- a/contrib/src/sparkle/sparkle-fix-compilation-on-snowleopard.patch
+++ b/contrib/src/sparkle/sparkle-fix-compilation-on-snowleopard.patch
@@ -72,7 +72,7 @@ diff -ru sparkle/SUBasicUpdateDriver.m sparkle-fixed/SUBasicUpdateDriver.m
  		[[updater delegate] updater:updater didFinishLoadingAppcast:ac];
  	
 -	NSDictionary *userInfo = (ac != nil) ? @{SUUpdaterAppcastNotificationKey : ac} : nil;
-+	NSDictionary *userInfo = (ac != nil) ? [NSDictionary dictionaryWithObject:SUUpdaterAppcastNotificationKey forKey:ac] : nil;
++	NSDictionary *userInfo = (ac != nil) ? [NSDictionary dictionaryWithObject:ac forKey:SUUpdaterAppcastNotificationKey] : nil;
  	[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFinishLoadingAppCastNotification object:updater userInfo:userInfo];
      
      SUAppcastItem *item = nil;
@@ -81,7 +81,7 @@ diff -ru sparkle/SUBasicUpdateDriver.m sparkle-fixed/SUBasicUpdateDriver.m
  	if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
  		[[updater delegate] updater:updater didFindValidUpdate:updateItem];
 -	NSDictionary *userInfo = (updateItem != nil) ? @{SUUpdaterAppcastItemNotificationKey : updateItem} : nil;
-+	NSDictionary *userInfo = (updateItem != nil) ? [NSDictionary dictionaryWithObject:SUUpdaterAppcastItemNotificationKey forKey:updateItem] : nil;
++	NSDictionary *userInfo = (updateItem != nil) ? [NSDictionary dictionaryWithObject:updateItem forKey:SUUpdaterAppcastItemNotificationKey] : nil;
  	[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFinishLoadingAppCastNotification object:updater userInfo:userInfo];
  	[self downloadUpdate];
  }
@@ -93,7 +93,7 @@ diff -ru sparkle/SUProbingUpdateDriver.m sparkle-fixed/SUProbingUpdateDriver.m
  	if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
  		[[updater delegate] updater:updater didFindValidUpdate:updateItem];
 -	NSDictionary *userInfo = (updateItem != nil) ? @{SUUpdaterAppcastItemNotificationKey : updateItem} : nil;
-+	NSDictionary *userInfo = (updateItem != nil) ? [NSDictionary dictionaryWithObject:SUUpdaterAppcastItemNotificationKey forKey:updateItem] : nil;
++	NSDictionary *userInfo = (updateItem != nil) ? [NSDictionary dictionaryWithObject:updateItem forKey:SUUpdaterAppcastItemNotificationKey] : nil;
  	[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification object:updater userInfo:userInfo];
  	[self abortUpdate];
  }
diff --git a/contrib/src/sparkle/sparkle-fix-runtime-exception-on-snowleopard.patch b/contrib/src/sparkle/sparkle-fix-runtime-exception-on-snowleopard.patch
deleted file mode 100644
index 17f519c2a5..0000000000
--- a/contrib/src/sparkle/sparkle-fix-runtime-exception-on-snowleopard.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -ru sparkle/SUBasicUpdateDriver.m sparkled/SUBasicUpdateDriver.m
---- sparkle/SUBasicUpdateDriver.m	2014-11-05 00:05:47.000000000 +0100
-+++ sparkled-fixed/SUBasicUpdateDriver.m	2014-11-04 23:48:19.000000000 +0100
-@@ -105,9 +105,6 @@
- {
- 	if ([[updater delegate] respondsToSelector:@selector(updater:didFinishLoadingAppcast:)])
- 		[[updater delegate] updater:updater didFinishLoadingAppcast:ac];
--	
--	NSDictionary *userInfo = (ac != nil) ? [NSDictionary dictionaryWithObject:SUUpdaterAppcastNotificationKey forKey:ac] : nil;
--	[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFinishLoadingAppCastNotification object:updater userInfo:userInfo];
-     
-     SUAppcastItem *item = nil;
-     



More information about the vlc-commits mailing list