Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ms_sid2nsld() can be dangerous with malformed FDSN Source IDs #118

Open
chad-earthscope opened this issue Dec 7, 2024 · 0 comments
Open

Comments

@chad-earthscope
Copy link
Contributor

ms_sid2nslc() does not check the length of the parsed codes when writing to the output buffers.

Since the function does not know the size of these buffers, a caller may assume that a size of 9, to accept the longest possible code in the FDSN Source ID specification, would be sufficient. But if a malformed Source ID is provided as input with codes longer than allowed the function will continue to write beyond the buffer length. Chaos ensues.

Ideally this function would have arguments for the sizes of these buffers. Short of that, it should limit the output to the maximum code sizes allowed by the specification.

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

No branches or pull requests

1 participant