h3 icon indicating copy to clipboard operation
h3 copied to clipboard

Null deference

Open QiAnXinCodeSafe opened this issue 5 years ago • 1 comments

There is no check for the failed malloc

https://github.com/uber/h3/blob/ed5c4f254af2ffbd527d507d3bdd7019df4120fc/src/h3lib/lib/h3Index.c#L355 This in turn would cause a segfault, when buff is dereferenced https://github.com/uber/h3/blob/ed5c4f254af2ffbd527d507d3bdd7019df4120fc/src/h3lib/lib/h3Index.c#L372

QiAnXinCodeSafe avatar Jan 17 '20 09:01 QiAnXinCodeSafe

Thanks for pointing this out. #241 should be useful for testing for this kind of error, by injecting allocation failures.

isaacbrodsky avatar Jan 17 '20 15:01 isaacbrodsky

I believe there is now a guard for this allocation.

isaacbrodsky avatar Aug 23 '22 16:08 isaacbrodsky