Repository navigation
Reject a TLE whose epoch field contains a letter - #430
Merged
Merged
Conversation
Checksum_Good() counts any character other than a digit or '-' as 0, so a letter that replaced a 0 in the epoch (columns 19-32 of line 1) keeps the checksum valid. Good_Elements() accepted such a set and Convert_Satellite_Data() then read the epoch only up to the letter, moving it by minutes without any error. Check in Good_Elements() that the epoch field is a well-formed number: a two digit year, a three digit day of year whose leading digits may be padded with spaces, and a fraction of day made of digits, followed by nothing but trailing spaces. test-001 now fails if a letter in the epoch is accepted or if a space-padded day of year is rejected. All 15941 element sets in the current CelesTrak active list are still accepted. Fixes csete#427
Owner
|
Thanks, it's merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #427.
Checksum_Good()counts any character other than a digit or-as 0, so a letter that replaces a0in the epoch field (columns 19-32 of line 1) leaves the checksum valid.Good_Elements()accepted such a set, andConvert_Satellite_Data()then read the epoch only up to the letter. With the example from the issue the epoch moves 14 min 16 s early without any error.This adds a check to
Good_Elements()that the epoch field is a well-formed number:Convert_Satellite_Data()already handles),A set that fails the check is rejected the same way as one with a bad checksum, so
Get_Next_Tle_Set()returns -2 and the TLE update and satellite loading code skip it.Testing
test-001now builds a copy of its element set withOin place of a0in the epoch and fails ifGood_Elements()accepts it, and also checks that a space-padded day of year is still accepted. It fails without the change and passes with it../autogen.sh && make && make checkpass;test-001andtest-002pass.Get_Next_Tle_Set(), before and after the change.