From 7e7feec1f4f6815fe9e0afd161540c8228aa6add Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 9 Jan 2018 16:05:36 +0100 Subject: Improved documentation on decoding flags Signed-off-by: Nikos Mavrogiannopoulos --- lib/decoding.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/decoding.c b/lib/decoding.c index 0ee35d3..05dc236 100644 --- a/lib/decoding.c +++ b/lib/decoding.c @@ -43,12 +43,19 @@ #define HAVE_TWO(x) (x>=2?1:0) +/* Decoding flags (dflags) used in several decoding functions. + * DECODE_FLAG_HAVE_TAG: The provided buffer includes a tag + * DECODE_FLAG_INDEFINITE: The provided buffer is of indefinite encoding (useful + * when no tags are present). + * DECODE_FLAG_LEVEL1: Internal flag to indicate a level of recursion for BER strings. + * DECODE_FLAG_LEVEL2: Internal flag to indicate two levels of recursion for BER strings. + * DECODE_FLAG_LEVEL3: Internal flag to indicate three levels of recursion for BER strings. + * This is the maximum levels of recursion possible to prevent stack + * exhaustion. + */ + #define DECODE_FLAG_HAVE_TAG 1 #define DECODE_FLAG_INDEFINITE (1<<1) -/* On indefinite string decoding, allow this maximum levels - * of recursion. Allowing infinite recursion, makes the BER - * decoder susceptible to stack exhaustion due to that recursion. - */ #define DECODE_FLAG_LEVEL1 (1<<2) #define DECODE_FLAG_LEVEL2 (1<<3) #define DECODE_FLAG_LEVEL3 (1<<4) -- cgit v1.2.1