rlancaste / stellarsolver

GNU General Public License v3.0
92 stars 47 forks source link

Uninitialised value in sep/extract.cpp #48

Open TallFurryMan opened 4 years ago

TallFurryMan commented 4 years ago

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.

knro commented 4 years ago

Initialize it how? by memset to 0 for example?

TallFurryMan commented 4 years ago

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.