commit | 99f47377c86987da550ac1ea393eda72fdc7acd8 | [log] [tgz] |
---|---|---|
author | Tim Duesterhus <tim@bastelstu.be> | Tue Mar 15 13:11:05 2022 +0100 |
committer | Willy Tarreau <w@1wt.eu> | Mon Mar 21 08:30:47 2022 +0100 |
tree | 0264360896e397863f7e863873b5c76e75b39629 | |
parent | ab398d8ff9d656c6ea81892de39867a7c6c8774c [diff] |
DEV: coccinelle: Fix incorrect replacement in ist.cocci We must not use `ist2()` if the value of `i.len` is derived from the value of `i.ptr`: i.ptr = "foo"; i.len = strlen(i.ptr);
diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci index 4945141..ea13d39 100644 --- a/dev/coccinelle/ist.cocci +++ b/dev/coccinelle/ist.cocci
@@ -3,9 +3,14 @@ expression p, l; @@ +( + i.ptr = p; + i.len = strlen(i.ptr); +| - i.ptr = p; - i.len = l; + i = ist2(p, l); +) @@ @@