Hello community,

here is the log from the commit of package modem-manager-gui for 
openSUSE:Factory checked in at 2019-11-09 23:45:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/modem-manager-gui (Old)
 and      /work/SRC/openSUSE:Factory/.modem-manager-gui.new.2990 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "modem-manager-gui"

Sat Nov  9 23:45:22 2019 rev:9 rq:746766 version:0.0.19.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/modem-manager-gui/modem-manager-gui.changes      
2018-08-03 12:35:27.479405519 +0200
+++ 
/work/SRC/openSUSE:Factory/.modem-manager-gui.new.2990/modem-manager-gui.changes
    2019-11-09 23:45:22.681741120 +0100
@@ -1,0 +2,7 @@
+Fri Nov  8 08:30:45 UTC 2019 - Dmitriy Perlow <[email protected]>
+
+- Added fix-crash.patch vs. bnc#1154301:
+  * Fix memory corruption because of wrong strsep() usage;
+  * Fix segfault in strftime_l() because of timestamps from future.
+
+-------------------------------------------------------------------

New:
----
  fix-crash.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ modem-manager-gui.spec ++++++
--- /var/tmp/diff_new_pack.9F9M43/_old  2019-11-09 23:45:23.521742351 +0100
+++ /var/tmp/diff_new_pack.9F9M43/_new  2019-11-09 23:45:23.533742367 +0100
@@ -33,6 +33,9 @@
 # Alternatively, if the file should not be executed, then ensure that it is not
 # marked as executable or don't install it in a path that is reserved for 
executables.
 Patch0:         95-mmgui-timestamp-notifier.diff
+# PATCH-FIX-OPENSUSE bnc#1154301 Fix memory corruption because of wrong 
strsep()
+# usage. Fix segfault in strftime_l() because of timestamps from future.
+Patch1:         fix-crash.patch
 
 BuildRequires:  fdupes
 BuildRequires:  gdbm-devel
@@ -66,6 +69,7 @@
 %prep
 %setup -q
 %patch0
+%patch1 -p1
 
 %build
 %configure

++++++ fix-crash.patch ++++++
# HG changeset patch
# User Alex <[email protected]>
# Date 1550936745 -10800
# Node ID 6710bf86869852bb8a9946b628eff5bc1019b5aa
# Parent  e8a146d4d2ea8525301670fb48b1accfdde13ac9
Fix memory corruption because of wrong strsep() usage (Thanks to Persmule)

diff --git a/src/modules/mm06.c b/src/modules/mm06.c
--- a/src/modules/mm06.c
+++ b/src/modules/mm06.c
@@ -1552,10 +1552,12 @@
        GVariantIter *iter;
        guint32 locationtype;
        GVariant *locationdata;
-       gchar *locationstring;
        gsize strlength;
+       gchar **fragments;
+       gint i;
        GError *error;
-                       
+       const gint numbases[4] = {10, 10, 16, 16};
+       
        if ((mmguicore == NULL) || (device == NULL)) return FALSE;
        mmguicorelc = (mmguicore_t)mmguicore;
        
@@ -1578,14 +1580,17 @@
                g_variant_get(data, "(a{uv})", &iter);
                while (g_variant_iter_next(iter, "{uv}", &locationtype, 
&locationdata)) {
                        if ((locationtype == 
MODULE_INT_MODEM_LOCATION_CAPABILITY_GSM_LAC_CI) && (locationdata != NULL)) {
-                               //3GPP location
+                               /*3GPP location*/
                                strlength = 256;
-                               locationstring = 
g_strdup(g_variant_get_string(locationdata, &strlength));
-                               device->loc3gppdata[0] = 
(guint)strtol(strsep(&locationstring, ","), NULL, 10);
-                               device->loc3gppdata[1] = 
(guint)strtol(strsep(&locationstring, ","), NULL, 10);
-                               device->loc3gppdata[2] = 
(guint)strtol(strsep(&locationstring, ","), NULL, 16);
-                               device->loc3gppdata[3] = 
(guint)strtol(strsep(&locationstring, ","), NULL, 16);
-                               g_free(locationstring);
+                               fragments = 
g_strsplit(g_variant_get_string(locationdata, &strlength), ",", 4);
+                               if (fragments != NULL) {
+                                       i = 0;
+                                       while ((fragments[i] != NULL) && (i < 
4)) {
+                                               device->loc3gppdata[i] = 
(guint)strtoul(fragments[i], NULL, numbases[i]);
+                                               i++;
+                                       }
+                                       g_strfreev(fragments);
+                               }
                                g_variant_unref(locationdata);
                                g_debug("3GPP location: %u, %u, %4x, %4x", 
device->loc3gppdata[0], device->loc3gppdata[1], device->loc3gppdata[2], 
device->loc3gppdata[3]);
                        }
diff --git a/src/modules/mm07.c b/src/modules/mm07.c
--- a/src/modules/mm07.c
+++ b/src/modules/mm07.c
@@ -1659,8 +1659,11 @@
        GVariant *locationdata;
        gchar *locationstring;
        gsize strlength;
+       gchar **fragments;
+       gint i;
        GError *error;
-                       
+       const gint numbases[4] = {10, 10, 16, 16};
+       
        if ((mmguicore == NULL) || (device == NULL)) return FALSE;
        mmguicorelc = (mmguicore_t)mmguicore;
        
@@ -1684,12 +1687,15 @@
                        if ((locationtype == 
MODULE_INT_MODEM_LOCATION_SOURCE_3GPP_LAC_CI) && (locationdata != NULL)) {
                                /*3GPP location*/
                                strlength = 256;
-                               locationstring = 
g_strdup(g_variant_get_string(locationdata, &strlength));
-                               device->loc3gppdata[0] = 
(guint)strtol(strsep(&locationstring, ","), NULL, 10);
-                               device->loc3gppdata[1] = 
(guint)strtol(strsep(&locationstring, ","), NULL, 10);
-                               device->loc3gppdata[2] = 
(guint)strtol(strsep(&locationstring, ","), NULL, 16);
-                               device->loc3gppdata[3] = 
(guint)strtol(strsep(&locationstring, ","), NULL, 16);
-                               g_free(locationstring);
+                               fragments = 
g_strsplit(g_variant_get_string(locationdata, &strlength), ",", 4);
+                               if (fragments != NULL) {
+                                       i = 0;
+                                       while ((fragments[i] != NULL) && (i < 
4)) {
+                                               device->loc3gppdata[i] = 
(guint)strtoul(fragments[i], NULL, numbases[i]);
+                                               i++;
+                                       }
+                                       g_strfreev(fragments);
+                               }
                                g_variant_unref(locationdata);
                                g_debug("3GPP location: %u, %u, %4x, %4x\n", 
device->loc3gppdata[0], device->loc3gppdata[1], device->loc3gppdata[2], 
device->loc3gppdata[3]);
                        } else if ((locationtype == 
MODULE_INT_MODEM_LOCATION_SOURCE_GPS_RAW) && (locationdata != NULL)) {
# HG changeset patch
# User Alex <[email protected]>
# Date 1558782045 -10800
# Node ID 83553d042443c71be71533b6b91ee10f228d935f
# Parent  de113e8953ae708043823578b64882cfc5a45ca2
Fix segfault in strftime_l() because of timestamps from future

diff --git a/src/strformat.c b/src/strformat.c
--- a/src/strformat.c
+++ b/src/strformat.c
@@ -1,7 +1,7 @@
 /*
  *      strformat.c
  *      
- *      Copyright 2013-2014 Alex <[email protected]>
+ *      Copyright 2013-2019 Alex <[email protected]>
  *      
  *      This program is free software: you can redistribute it and/or modify
  *      it under the terms of the GNU General Public License as published by
@@ -182,18 +182,22 @@
                
        memset(buffer, 0, bufsize);
        
-       if (delta <= 0.0) {
-               if (strftime(buffer, bufsize, _("Today, %T"), ftime) == 0) {
-                       g_snprintf(buffer, bufsize, _("Unknown"));
-               }
-       } else if ((delta > 0.0) && (delta < 86400.0)) {
-               if (strftime(buffer, bufsize, _("Yesterday, %T"), ftime) == 0) {
-                       g_snprintf(buffer, bufsize, _("Unknown"));
+       if (ftime != NULL) {
+               if (delta <= 0.0) {
+                       if (strftime(buffer, bufsize, _("Today, %T"), ftime) == 
0) {
+                               g_snprintf(buffer, bufsize, _("Unknown"));
+                       }
+               } else if ((delta > 0.0) && (delta < 86400.0)) {
+                       if (strftime(buffer, bufsize, _("Yesterday, %T"), 
ftime) == 0) {
+                               g_snprintf(buffer, bufsize, _("Unknown"));
+                       }
+               } else {
+                       if (strftime(buffer, bufsize, _("%d %B %Y, %T"), ftime) 
== 0) {
+                               g_snprintf(buffer, bufsize, _("Unknown"));
+                       }
                }
        } else {
-               if (strftime(buffer, bufsize, _("%d %B %Y, %T"), ftime) == 0) {
-                       g_snprintf(buffer, bufsize, _("Unknown"));
-               }
+               g_snprintf(buffer, bufsize, _("Unknown"));
        }
        
        return buffer;

Reply via email to