fiorix / go-diameter

Diameter stack and Base Protocol (RFC 6733) for the Go programming language
Other
252 stars 143 forks source link

Dangling AVP references in readerBufferPool #164

Open jefftt opened 2 years ago

jefftt commented 2 years ago

It is possible for AVPs to be overwritten or their memory dropped while still being processed, if the underlying readerBuffer is reused or the underlying sync.Pool removes it respectively. This is because for some avp datatypes are references into the original buffer, and the original buffer is reset and put back into the readerBufferPool right after the message is decoded [ref].

Affected datatypes are:

Quick fix would be just to copy out of the original read buffers for these types