mouse07410 / asn1c

The ASN.1 Compiler
http://lionet.info/asn1c/
BSD 2-Clause "Simplified" License
101 stars 73 forks source link

uper_open_type_skip bug #129

Closed johnhypo closed 11 months ago

johnhypo commented 1 year ago

Look at comment in code. Help!

int
uper_open_type_skip(asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
    asn_TYPE_descriptor_t s_td;
    asn_dec_rval_t rv;

    s_td.name = "<unknown extension>";
//s_td not initiallized, this  assignment statement crashes.
//it occured while I use asn1c to parse PDU MultimediaSystemControlMessage
//refer to https://github.com/vlm/asn1c/issues/475
    s_td.op->uper_decoder = uper_sot_suck;

    rv = uper_open_type_get(ctx, &s_td, 0, 0, pd);
    if(rv.code != RC_OK)
        return -1;
    else
        return 0;
}
mouse07410 commented 1 year ago

This is probably beyond my competency - but there's no need to "initialize" anything there, IMHO.

asn_TYPE_descriptor_t is a structure with a field name that is a pointer to a string. The code assigns to it a pointer to "<unknown_extension>". I don't see a problem there, from C point of view.

Perhaps, with more information (like OS, compiler, etc.) and a minimal reproducer, I could try to dig deeper...?

mouse07410 commented 11 months ago

Since I don't know what to do with this issue, sorry to say I'm closing it. Please re-open if you have anything to add that would make it easier to determine what's wrong and how to fix it.