stellarsolver icon indicating copy to clipboard operation
stellarsolver copied to clipboard

Uninitialised value in sep/extract.cpp

Open TallFurryMan opened this issue 5 years ago • 2 comments

https://github.com/rlancaste/stellarsolver/blob/e0aa8d394aa9ddd5ad9c1052fff249d019913c49/stellarsolver/sep/extract.cpp#L632-L635

There is a code path that uses psstack without initialising it after allocation. That initialisation should probably be done around line 317.

TallFurryMan avatar Oct 27 '20 12:10 TallFurryMan

Initialize it how? by memset to 0 for example?

knro avatar Nov 02 '20 08:11 knro

This is implementation-dependent. The code uses an uninitialised value, so results are undefined.

That's not what we want, so I'm not sure I get your question. This said, I suspect this happens in edge cases where markers are not written in the right order in the file, so any initialisation value would work.

TallFurryMan avatar Nov 02 '20 08:11 TallFurryMan