From: Mathieu Desnoyers Date: Thu, 23 Apr 2015 21:13:41 +0000 (-0400) Subject: Fix: string length calculation reversed user vs kernel args X-Git-Tag: v2.7.0-rc1~41 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=96d0248acf6775375dd69fb5574c2c5283e54052;p=lttng-modules.git Fix: string length calculation reversed user vs kernel args Only affects feature recently merged into master. Signed-off-by: Mathieu Desnoyers --- diff --git a/probes/lttng-events.h b/probes/lttng-events.h index 58f4e120..a6c36b08 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -327,10 +327,10 @@ static void __event_probe__##_name(void *__data); #define _ctf_string(_item, _src, _user, _nowrite) \ if (_user) \ __event_len += __dynamic_len[__dynamic_len_idx++] = \ - strlen(_src) + 1; \ + max_t(size_t, lttng_strlen_user_inatomic(_src), 1); \ else \ __event_len += __dynamic_len[__dynamic_len_idx++] = \ - max_t(size_t, lttng_strlen_user_inatomic(_src), 1); + strlen(_src) + 1; #undef TP_PROTO #define TP_PROTO(...) __VA_ARGS__