From cffe1b112a7362f477b08634cb3bccf0f22d840a Mon Sep 17 00:00:00 2001 From: Dave Cridland Date: Wed, 23 May 2018 21:01:44 +0100 Subject: [PATCH] Remove static qualifier from var in SET_OF__encode_sorted The function `SET_OF__encode_sorted` stored the working element buffer in a static variable. If called recursively (that is, when performing encoding of a SET containing another SET) the outermost element buffer is therefore clobbered by the innermost call. This causes a SEGV on continuation of the outermost call. Bug found during testing of [https://github.com/surevine/spiffing Spiffing], fix verified with the same test suite. --- skeletons/constr_SET_OF.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skeletons/constr_SET_OF.c b/skeletons/constr_SET_OF.c index 96c5c09e..02fc5156 100644 --- a/skeletons/constr_SET_OF.c +++ b/skeletons/constr_SET_OF.c @@ -356,7 +356,7 @@ static struct _el_buffer * SET_OF__encode_sorted(const asn_TYPE_member_t *elm, const asn_anonymous_set_ *list, enum SET_OF__encode_method method) { - static struct _el_buffer *encoded_els; + struct _el_buffer *encoded_els; int edx; encoded_els =