#include <wrapper/uaccess.h>
#include <lttng/probe-user.h>
+#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
if (unlikely(ret > 0))
break;
count++;
+ if (unlikely(count > LTTNG_MAX_USER_STRING_LEN))
+ break;
if (unlikely(!v))
break;
addr++;