Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Hi,

This is a pre-upload unblock request for lgogdownloader. The version
currently in Stretch (and unstable) has a nasty bug (#857691) which
can make the whole package unusable in certain circumstances —
basically, lgogdownloader crashes with user accounts containing
downloadable content for games that the account doesn't own (which can
happen unfortunately).

Upstream have released a fix for this, and Simon McVittie has pushed
it to the package VCS. The resulting diff, were I to upload the
package to unstable, would be

diff --git a/debian/changelog b/debian/changelog
index bfbc456..9b5a3c4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+lgogdownloader (3.1-2) unstable; urgency=medium
+
+  [ Simon McVittie ]
+  * Team upload
+  * Backport patch from 3.2 fixing the ability to list games if a game
+    has {'updates': null} (Closes: #857691)
+
+ -- Stephen Kitt <sk...@debian.org>  Sun, 26 Mar 2017 18:58:18 +0200
+
 lgogdownloader (3.1-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/patches/Fix-crash-in-Website-getGames.patch 
b/debian/patches/Fix-crash-in-Website-getGames.patch
new file mode 100644
index 0000000..a689162
--- /dev/null
+++ b/debian/patches/Fix-crash-in-Website-getGames.patch
@@ -0,0 +1,49 @@
+From: Sude <lgogdownloa...@gmail.com>
+Date: Fri, 20 Jan 2017 00:15:50 +0200
+Subject: Fix crash in Website::getGames
+
+JSON value for updates can be null in some cases. For example when user owns a 
dlc but not the base game.
+This caused a crash due to std::stoi throwing std::invalid_argument exception
+
+Origin: upstream, 3.2, commit:22f47de4fcd8cd7ecc2a89fbb25f94efb1b3f743
+---
+ src/website.cpp | 26 +++++++++++++++++++++++++-
+ 1 file changed, 25 insertions(+), 1 deletion(-)
+
+diff --git a/src/website.cpp b/src/website.cpp
+index 0803432..8ca4c8c 100644
+--- a/src/website.cpp
++++ b/src/website.cpp
+@@ -163,7 +163,31 @@ std::vector<gameItem> Website::getGames()
+                 gameItem game;
+                 game.name = product["slug"].asString();
+                 game.id = product["id"].isInt() ? 
std::to_string(product["id"].asInt()) : product["id"].asString();
+-                game.updates = product["updates"].isInt() ? 
product["updates"].asInt() : std::stoi(product["updates"].asString());
++
++                if (product.isMember("updates"))
++                {
++                    if (product["updates"].isNull())
++                    {
++                        /* In some cases the value can be null.
++                         * For example when user owns a dlc but not the base 
game
++                         * https://github.com/Sude-/lgogdownloader/issues/101
++                         * Assume that there are no updates in this case */
++                        game.updates = 0;
++                    }
++                    else if (product["updates"].isInt())
++                        game.updates = product["updates"].asInt();
++                    else
++                    {
++                        try
++                        {
++                            game.updates = 
std::stoi(product["updates"].asString());
++                        }
++                        catch (std::invalid_argument& e)
++                        {
++                            game.updates = 0; // Assume no updates
++                        }
++                    }
++                }
+ 
+                 unsigned int platform = 0;
+                 if (product["worksOn"]["Windows"].asBool())
diff --git a/debian/patches/series b/debian/patches/series
index 48af9e8..69eb314 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
+Fix-crash-in-Website-getGames.patch
 manpage-whatis.patch


Is this OK?

unblock lgogdownloader/3.1-1

Regards,

Stephen


-- System Information:
Debian Release: 9.0
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing'), (500, 'stable'), (200, 
'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Reply via email to