All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Murray <andrew.murray@arm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: smatch@vger.kernel.org
Subject: [PATCH 1/4] smdb.py: fix handling of capped ranges
Date: Mon,  8 Jul 2019 12:22:18 +0100	[thread overview]
Message-ID: <20190708112221.22983-2-andrew.murray@arm.com> (raw)
In-Reply-To: <20190708112221.22983-1-andrew.murray@arm.com>

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 <andrew.murray@arm.com>
---
 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

  reply	other threads:[~2019-07-08 11:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 11:22 [PATCH 0/4] Miscellaneous fixes Andrew Murray
2019-07-08 11:22 ` Andrew Murray [this message]
2019-07-08 11:22 ` [PATCH 2/4] smdb.py: fix param tracking now that we use $ instead of p Andrew Murray
2019-07-08 11:22 ` [PATCH 3/4] user_data: Recognize uaccess for non-x86 architectures Andrew Murray
2019-07-08 11:22 ` [PATCH 4/4] kchecker: remove debug Andrew Murray
2019-07-17 10:18 ` [PATCH 0/4] Miscellaneous fixes Dan Carpenter
2019-10-07 14:20   ` Andrew Murray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190708112221.22983-2-andrew.murray@arm.com \
    --to=andrew.murray@arm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=smatch@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.