X-Git-Url: http://git.liburcu.org/?p=lttng-modules.git;a=blobdiff_plain;f=src%2Fprobes%2Flttng-probe-user.c;h=592d948b1498e66f570ae8cc2a9e6906304a1750;hp=009cfed004c65d124229301365df8582f896db53;hb=eb94dcd91d4ea827ebe0353249e309f1629a5032;hpb=da139c48d2e211028d4575d01caee17d4c26303a diff --git a/src/probes/lttng-probe-user.c b/src/probes/lttng-probe-user.c index 009cfed0..592d948b 100644 --- a/src/probes/lttng-probe-user.c +++ b/src/probes/lttng-probe-user.c @@ -10,6 +10,8 @@ #include #include +#define LTTNG_MAX_USER_STRING_LEN 1048576 /* 1MB */ + /* * Calculate string length. Include final null terminating character if there is * one, or ends at first fault. Disabling page faults ensures that we can safely @@ -41,6 +43,8 @@ long lttng_strlen_user_inatomic(const char *addr) if (unlikely(ret > 0)) break; count++; + if (unlikely(count > LTTNG_MAX_USER_STRING_LEN)) + break; if (unlikely(!v)) break; addr++;