~ubuntu-branches/ubuntu/vivid/asn1c/vivid

« back to all changes in this revision

Viewing changes to skeletons/xer_decoder.c

  • Committer: Bazaar Package Importer
  • Author(s): W. Borgert
  • Date: 2006-09-23 13:50:05 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20060923135005-rmay0d69e5vhunai
* New build, forgot to separate sources/diff.
* New release (closes: #327621).

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
        asn_codec_ctx_t s_codec_ctx;
17
17
 
18
18
        /*
19
 
         * Satisfy the requirement that the codec context
 
19
         * Stack checker requires that the codec context
20
20
         * must be allocated on the stack.
21
21
         */
22
 
        if(opt_codec_ctx && opt_codec_ctx->max_stack_size) {
23
 
                s_codec_ctx = *opt_codec_ctx;
 
22
        if(opt_codec_ctx) {
 
23
                if(opt_codec_ctx->max_stack_size) {
 
24
                        s_codec_ctx = *opt_codec_ctx;
 
25
                        opt_codec_ctx = &s_codec_ctx;
 
26
                }
 
27
        } else {
 
28
                /* If context is not given, be security-conscious anyway */
 
29
                memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
 
30
                s_codec_ctx.max_stack_size = _ASN_DEFAULT_STACK_MAX;
24
31
                opt_codec_ctx = &s_codec_ctx;
25
32
        }
26
33
 
124
131
                }
125
132
        }
126
133
 
 
134
        /* Sometimes we don't care about the tag */
 
135
        if(!need_tag || !*need_tag)
 
136
                return (xer_check_tag_e)(XCT__UNK__MASK | ct);
 
137
 
127
138
        /*
128
139
         * Determine the tag name.
129
140
         */
162
173
#define RETURN(_code)   do {                                    \
163
174
                rval.code = _code;                              \
164
175
                rval.consumed = consumed_myself;                \
 
176
                if(rval.code != RC_OK)                          \
 
177
                        ASN_DEBUG("Failed with %d", rval.code); \
165
178
                return rval;                                    \
166
179
        } while(0)
167
180