smuellerDD / jitterentropy-library

Jitterentropy Library
http://www.chronox.de/jent
Other
101 stars 40 forks source link

jent_read_entropy_safe() may return with dangling pointer in *ec. #97

Closed jc2a closed 1 year ago

jc2a commented 1 year ago

On a failure of jent_read_entropy() where the entropy collector will be reallocated, jent_entropy_collector_free() is used to release ec, but ec is not set to NULL. If a failure occurs in the following call to jent_entropy_collector_ex() then the function will return with a dangling pointer remaining in ec. Set ec to NULL after freeing to prevent this.

joshuaehill commented 1 year ago

I suspect that this is the reason for the observed core dumps in #88.

smuellerDD commented 1 year ago

Applied, thanks.