OneOfOne/go-utils

Overflow in ByteSlice

Closed this issue · 3 comments

Hi. Neat utils lib. Was reading the ByteSlice function and realized that by taking a pointer to a SliceHeader, having a size of 3*sizeof(uintptr), from a StringHeader, having a size of 2*sizeof(uintptr), the Cap is overflowed.. You can see here that it is not initialized:

https://play.golang.org/p/kAq2in_Ho6

I'll check it out, thanks!

Thanks for finding this bug, I need to go through this library again.

BTW, it caused memory corruption, check https://play.golang.org/p/243R2LWVQj

Cool, no worries.

On Wed, Aug 10, 2016 at 7:51 PM, Ahmed W. notifications@github.com wrote:

Thanks for finding this bug, I need to go through this library again.

BTW, it caused memory corruption, check https://play.golang.org/p/
243R2LWVQj


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAO0eBhp9YOtSU9UlnwYEw-lzI71SFC9ks5qemP_gaJpZM4JesjK
.