Skip to content

Add NULL checks to sam_hdr_read(), sam_hdr_write(); add checks to test/sam.c copy_check_alignment()#730

Merged
jkbonfield merged 2 commits into
samtools:developfrom
daviesrob:asan
Jul 9, 2018
Merged

Add NULL checks to sam_hdr_read(), sam_hdr_write(); add checks to test/sam.c copy_check_alignment()#730
jkbonfield merged 2 commits into
samtools:developfrom
daviesrob:asan

Conversation

@daviesrob
Copy link
Copy Markdown
Member

Check for NULL fp in sam_hdr_read(), sam_hdr_write()

Add more tests for failure in copy_check_alignment()

Catch problems like sam_open() and sam_read1() failing. Prevents a seg fault if sam_open() fails on either the input or output file. #728 triggered this by running ./sam in the test directory instead of ./test/sam in the base directory.

Fixes #728

daviesrob added 2 commits July 9, 2018 16:49
Catch problems like sam_open() and sam_read1() failing.  Prevents
a seg fault if sam_open() fails on either the input or output file.

Fixes samtools#728 (A SEGV signal occurred when running program sam in test
directory).
@jkbonfield jkbonfield merged commit 0c0623f into samtools:develop Jul 9, 2018
@daviesrob daviesrob deleted the asan branch July 9, 2018 17:27
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