loopholelabs/frisbee-go

RPC Slice Decoder does not allocate memory for pointers

Closed this issue · 0 comments

the RPC decoder generator creates code like the following for slices:

		if uint32(len(x.VerificationKey)) != sliceSize {
			x.VerificationKey = make([]*VerificationKey, sliceSize)
		}
		for i := uint32(0); i < sliceSize; i++ {
			err = x.VerificationKey[i].decode(d)
			if err != nil {
				return err
			}
		}

The issue with this is that it does not allocate the pointer at x.VerificateKey[i] - and this causes a panic during runtime.