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

Add an fai_line_length function. #1516

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

jkbonfield
Copy link
Contributor

This exposes the input datas line wrap length (minus white-space / newlines).

Also fixed a SEGV in fai_retrieve given incorrect or malicious .fai files with a zero length "blen" figure.

This exposes the input datas line wrap length (minus white-space /
newlines).

Also fixed a SEGV in fai_retrieve given incorrect or malicious .fai
files with a zero length "blen" figure.
@daviesrob
Copy link
Member

Looks OK, although I spotted a couple of TODOs for later.

  • fai_get_val() fbeg and fend are hts_pos_t *, but everything calling it passes int64_t *. This affects more then the new function, so probably best tidied up separately.
  • Currently, zero-length sequences get excluded from the index, but if they were present they would presumably have all lengths as zero and would upset the new blen check. I think there may be other issues around including such horrors, so I don't think it's a problem at the moment.

@daviesrob daviesrob merged commit 3c6f83f into samtools:develop Oct 20, 2022
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.

2 participants