Closed bluescarni closed 3 days ago
Is this the correct place so submit a PR or should I bring the issue directly to Vallado/celestrak?
Alas, this python-sgp4 project merely packages the upstream C++ code for consumption by Python programmers. It doesn't make any changes to the code, lest its behavior from Python differ in any way from its behavior when called from other languages. You will want to offer a fix upstream to Vallado. I'll be happy to update python-sgp4 with new upstream code whenever that is released.
(And, thanks for the well-written description! I wouldn't have known quite what to do had I seen only the error message.)
Hello!
Today I compiled the sgp4 C++ code from source with the address sanitizer enabled, and the following error was reported:
The sanitizer is complaining that
strcpy()
is being used with identical source and destination arguments, which is something that one is not supposed to do:https://www.man7.org/linux/man-pages/man3/strcpy.3.html
(see the CAVEATS section at the bottom)
This is the offending line (1437 in SGP4.cpp):
Which, in turn, is part of the invocation of
sgp4init()
at line 2437 in SGP4.cpp:So,
satrec.satnum
ultimately ends up being copied onto itself, hence the sanitizer error.The fix should be as simple as skipping the
strcpy()
altogether if the source and destination pointers are the same. Is this the correct place so submit a PR or should I bring the issue directly to Vallado/celestrak?