[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kwindowsystem/v5.3.1] src: Fix incorrect count of netwm atoms
From:       l10n daemon script <scripty () kde ! org>
Date:       2014-10-10 22:40:09
Message-ID: E1Xcir3-0000hy-Dl () scm ! kde ! org
[Download RAW message or body]

Git commit f6ef81857281bea0e1903557e102aceced236427 by l10n daemon script, on behalf of Martin Gräßlin.
Committed on 09/10/2014 at 09:06.
Pushed by dfaure into tag 'v5.3.1'.

Fix incorrect count of netwm atoms

This fixes a regression introduced with
59cb063b99e6ec13c0bc3cf3fd95a01258184e86.

The commit added 4 new atoms but only incremented the atom count by 3.
Which can cause a crash as soon as the NET classes are used.

To ensure that such an error is not introduced again, an assert is
added.

BUG: 339771
REVIEW: 120539

M  +2    -1    src/netwm.cpp

http://commits.kde.org/kwindowsystem/f6ef81857281bea0e1903557e102aceced236427

diff --git a/src/netwm.cpp b/src/netwm.cpp
index 3107a23..7b398d4 100644
--- a/src/netwm.cpp
+++ b/src/netwm.cpp
@@ -386,7 +386,7 @@ static QByteArray get_atom_name(xcb_connection_t *c, xcb_atom_t atom)
 }
 #endif
 
-static const int netAtomCount = 91;
+static const int netAtomCount = 92;
 
 static void create_netwm_atoms(xcb_connection_t *c)
 {
@@ -498,6 +498,7 @@ static void create_netwm_atoms(xcb_connection_t *c)
     };
 
     assert(!netwm_atoms_created);
+    assert(sizeof(atoms)/sizeof(atoms[0]) == netAtomCount + 1);
 
     // Send the intern atom requests
     xcb_intern_atom_cookie_t cookies[netAtomCount];
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic