From 5b4839a83a25b95484a4689082fb44bcc8906ef9 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 27 Aug 2012 15:17:47 -0400 Subject: [PATCH] Fix: accept 65536 bytes long bytecodes We were limited to 65535. Signed-off-by: Mathieu Desnoyers --- include/lttng/ust-abi.h | 2 +- liblttng-ust/lttng-filter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/lttng/ust-abi.h b/include/lttng/ust-abi.h index 766a7e6a..a72d67ef 100644 --- a/include/lttng/ust-abi.h +++ b/include/lttng/ust-abi.h @@ -171,7 +171,7 @@ struct lttng_ust_calibrate { } u; }; -#define FILTER_BYTECODE_MAX_LEN 65535 +#define FILTER_BYTECODE_MAX_LEN 65536 struct lttng_ust_filter_bytecode { uint16_t len; uint16_t reloc_offset; diff --git a/liblttng-ust/lttng-filter.c b/liblttng-ust/lttng-filter.c index 369e73aa..68a59311 100644 --- a/liblttng-ust/lttng-filter.c +++ b/liblttng-ust/lttng-filter.c @@ -184,7 +184,7 @@ int apply_field_reloc(struct ltt_event *event, return -EINVAL; /* Check if field offset is too large for 16-bit offset */ - if (field_offset > FILTER_BYTECODE_MAX_LEN) + if (field_offset > FILTER_BYTECODE_MAX_LEN - 1) return -EINVAL; /* set type */ -- 2.34.1