From: Tim Duesterhus Date: Tue, 15 Mar 2022 12:11:05 +0000 (+0100) Subject: DEV: coccinelle: Fix incorrect replacement in ist.cocci X-Git-Tag: v2.6-dev4~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99f47377c86987da550ac1ea393eda72fdc7acd8;p=thirdparty%2Fhaproxy.git 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 4945141b25..ea13d39d25 100644 --- a/dev/coccinelle/ist.cocci +++ b/dev/coccinelle/ist.cocci @@ -3,9 +3,14 @@ struct ist i; expression p, l; @@ +( + i.ptr = p; + i.len = strlen(i.ptr); +| - i.ptr = p; - i.len = l; + i = ist2(p, l); +) @@ @@