Skip to content

Match scope buffer to prevent overflow#62

Open
XePeleato wants to merge 1 commit intoBill-Gray:masterfrom
XePeleato:patch-1
Open

Match scope buffer to prevent overflow#62
XePeleato wants to merge 1 commit intoBill-Gray:masterfrom
XePeleato:patch-1

Conversation

@XePeleato
Copy link
Copy Markdown

The longest the TEL keyword can be is 59 characters + null terminator. This is not a problem for any telescope in details.txt except for I15, which is 60 characters long and overflows by one letter. This crashes the program.

To reproduce, generate ephemeris for any object in which I15 is involved, such as 2014 FN33. When clicking back, the program will crash:
image

It looks like I15 is the only offending line, maybe there could be an awk check to the GitHub pipeline to prevent from other observatories breaking in the same way, or just making the buffer longer.

cc: @focanag

The longest the TEL keyword can be is 59 characters + null terminator. This is not a problem for any telescope in details.txt except for I15, which is 60 characters long and overflows by one letter. This crashes the program.
Bill-Gray added a commit that referenced this pull request Jun 22, 2025
…ther all ADES-limited components) could reach about 220 bytes. The buffer we use could actually handle NAME_LIST_SIZE = 300 bytes anyway. Fixes issue #62.
@Bill-Gray
Copy link
Copy Markdown
Owner

Thank you. I also got a report about this on Friday; I'll copy my reply (modified quite a bit) below.

I think I just arbitrarily chose 60 bytes as a limit because it is "obviously" more than enough; i.e., any telescope description longer than 60 bytes would "obviously" mean an error. But the offending (I15) example doesn't seem too excessive a telescope description. Some might add in "4096x4096 UltraCam CCD" and such.

Looking through the ADES specification, 100 bytes are allowed for the telescope 'name', 25 for the 'design', six for the 'aperture', 25 for the 'detector', and so on. The total comes to 218 bytes; expanded to human-readable form, it'll be slightly more than that.

I've revised the limit to be NAME_LIST_SIZE, 300 bytes (the scope buffer can contain that, plus 20 bytes of padding because we'll insert text such as 'Observers' and so forth.)

So this particular issue is fixed. However, it led me to notice that the lists of measurers and observers is similarly capped at 300 bytes. The only limit imposed by ADES is that the individual names must be less than 100 bytes. Consider this file, from the (T09) Subaru TNO collaboration, from MPEC 2025-L53 :

t09.txt

Find_Orb reads in observers up to S. Mineo, detects that adding further observers would overflow the buffer, and ignores them. So I'll have to fix that (probably just by using a larger buffer).

@JiaoYinger
Copy link
Copy Markdown

Hello, what's your email address? For the code you contribute to GitHub, you need to consult.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants