layeh/radius

Infinite loop on calling _ThreeGPP_SetVendor() in generated library

karnh opened this issue · 1 comments

karnh commented

I generated library from dictionary file present at https://github.com/wireshark/wireshark/blob/master/radius/dictionary.3gpp. But call to _ThreeGPP_SetVendor() from ThreeGPPGGSNMCCMNC_SetString() in the generated library is running into infinite loop.

Adding i++ in below generated code fixed this issue for me -

func _ThreeGPP_SetVendor(p *radius.Packet, typ byte, attr radius.Attribute) (err error) {
    for i := 0; i < len(p.Attributes); {
        avp := p.Attributes[i]
        if avp.Type != rfc2865.VendorSpecific_Type {
            i++
            continue
        }
        ...

Thanks for catching this, @karnh!