rsocket / rsocket-js

JavaScript implementation of RSocket
https://github.com/rsocket/rsocket-js
Apache License 2.0
594 stars 97 forks source link

fix/custom metadata header alloc #231

Closed viglucci closed 2 years ago

viglucci commented 2 years ago

Addresses #230

Motivation:

Usage of Buffer.allocUnsafe had the potential for leaking previously allocated memory in custom metadata headers.

Modifications:

Fill buffer allocated for custom metadata header prior to writing.

Result:

Buffer allocated for custom metadata header is prevented from containing values from previously allocated memory.