Skip to content

A letter in a TLE's epoch field passes Good_Elements() and the epoch is read up to it #427

Description

@hneogy

In Gpredict 2.6, a TLE whose epoch field has the letter O in place of a 0 passes Good_Elements(), and Convert_Satellite_Data() reads the epoch up to the letter, with no error. The checksum still holds, since a letter counts 0 like the digit it replaced.

VANGUARD DEB
1 69999U 58002D   26189.7O990935 -.00000023  00000+0 -70517-5 0  9996
2 69999  34.2417 341.8745 1487004  19.9191 345.3718 11.62373363189308

Column 26 of line 1 is the letter O.

Get_Next_Tle_Set() returns 1 for this set and tle.epoch is 26189.7; with the 0 in place (26189.70990935) it is 26189.70990935, so the altered line puts the epoch 14 min 16 s early. The conversion is g_ascii_strtod(buff, NULL) (src/sgpsdp/sgp_in.c:136), and the end pointer it discards is what would show where it stopped. I ran sgp_in.c from v2.6 in a small harness, with strtod() standing in for g_ascii_strtod(), not the full application.

The same line through other TLE readers, with a fix for each language: https://github.com/hneogy/gp-omm-conformance/blob/main/docs/LETTER-IN-FIELD.md

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions