[PATCH 1/4] smdb.py: fix handling of capped ranges

Andrew Murray <[email protected]>
Newsgroups org.kernel.vger.smatch
Message-ID <[email protected]>
The get_next_str function of smdb.py does not understand ranges that
have flags in square brackets. This results in a range such as
"0,4096-18446744073709547520[c]" being interpreted as 0->0 and 4096->0.

Let's fix this by breaking when we reach an opening square bracket.

Signed-off-by: Andrew Murray <[email protected]>
---
 smatch_data/db/smdb.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/smatch_data/db/smdb.py b/smatch_data/db/smdb.py
index c0b310b13b1d..1e089b4804bd 100755
--- a/smatch_data/db/smdb.py
+++ b/smatch_data/db/smdb.py
@@ -267,7 +267,7 @@ def get_next_str(txt):
         if txt[0] == '-':
             parsed += 1
         for char in txt[parsed:]:
-            if char == '-':
+            if char == '-' or char == '[':
                 break
             parsed += 1
         val = txt[:parsed]
-- 
2.21.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.