Match scope buffer to prevent overflow#62
Conversation
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.
…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.
|
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 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 : 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). |
|
Hello, what's your email address? For the code you contribute to GitHub, you need to consult. |
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:

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