From 1e05a7181484150177da75a3a2fb43562d2c7520 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 21 May 2012 14:46:49 +0200 Subject: [PATCH] Fix bug completeBER_n WRT too nested BER Function completeBER_n could return 0 (incomplete package) in case where the BER package was considered too nested (return value of -2). --- src/ber_any.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ber_any.c b/src/ber_any.c index d5edc77..905b0c4 100644 --- a/src/ber_any.c +++ b/src/ber_any.c @@ -109,10 +109,9 @@ int completeBER_n(const unsigned char *buf, int len, int level) { if (b[0] == 0 && b[1] == 0) break; - if (!(res = completeBER_n(b, len, level+1))) - return 0; - if (res == -1) - return -1; + res = completeBER_n(b, len, level+1); + if (res <= 0) + return res; b += res; len -= res; } -- 1.7.10.4