theft icon indicating copy to clipboard operation
theft copied to clipboard

theft_random_bits_bulk isn't zeroing buffer

Open dcreager opened this issue 5 years ago • 1 comments

The docs for theft_random_bits_bulk say that it will zero the buffer before filling in the random data that comes out of the PRNG, but it doesn't look like that is happening. The data is ORed into the buffer:

https://github.com/silentbicycle/theft/blob/62e093d9e33bb4218736dce2535eedda2904b8ba/src/theft_random.c#L75

but I don't see anywhere that's zeroing the buffer first. (:tophat: to valgrind tracking undefined data values for catching this!)

I can work around this with a memset before calling theft_random_bits_bulk, but wanted to report it upstream too!

dcreager avatar May 01 '20 16:05 dcreager

Thanks for reporting this, it will be fixed in the next release.

silentbicycle avatar May 18 '20 11:05 silentbicycle