svenvc / zodiac

Zodiac is an open-source Smalltalk framework implementing TLS/SSL secure as well as regular socket streams.
MIT License
9 stars 13 forks source link

Make ZdcIoBuffer growable #7

Closed PierceNg closed 4 years ago

PierceNg commented 4 years ago

ZdcAbstractSocketStream initializes read and write buffers to 4096 bytes each. I was getting buffer full errors in an application, so I implemented code to grow the buffers by doubling their sizes up to a parameterized limit. Happy to create a PR so that the code can be reviewed.

svenvc commented 4 years ago

Hi Pierce,

Would it be possible to share or at least describe how you got this buffer overflow ? This should not happen as reading into the buffer takes their size into account.

The only place that could be a problem (IIRC) is when decrypting the size could grow more than expected (and there is no real upper limit), see the method initializeBuffers.

Of course there always could be a bug somewhere, and then we need to find it.

Sven

PierceNg commented 4 years ago

Hi Sven,

I ran with the minimal image and couldn't get much info other than 'buffer full'. Unfortunately, or I should say happily, since then there hasn't been crashes. I still can't provide more info. Ok to close the issue. (I'd close it myself, but this is your repo and I don't know the protocol for such things.)

svenvc commented 4 years ago

OK, if the problem returns, we can come back to this issue.

Thanks for the feedback.