Commit 0c0623f
Add NULL checks to sam_hdr_read(), sam_hdr_write(); add checks to test/sam.c copy_check_alignment() (#730)
* 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.
Fixes #728 (A SEGV signal occurred when running program sam in test
directory).1 parent 6565adf commit 0c0623f
2 files changed
Lines changed: 35 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
1010 | 1015 | | |
1011 | 1016 | | |
1012 | 1017 | | |
| |||
1061 | 1066 | | |
1062 | 1067 | | |
1063 | 1068 | | |
1064 | | - | |
| 1069 | + | |
1065 | 1070 | | |
1066 | 1071 | | |
1067 | 1072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
462 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
463 | 477 | | |
464 | 478 | | |
465 | | - | |
| 479 | + | |
466 | 480 | | |
| 481 | + | |
| 482 | + | |
467 | 483 | | |
468 | 484 | | |
469 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
470 | 490 | | |
471 | 491 | | |
472 | | - | |
| 492 | + | |
473 | 493 | | |
474 | 494 | | |
475 | 495 | | |
476 | 496 | | |
477 | 497 | | |
478 | 498 | | |
479 | 499 | | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
480 | 503 | | |
| 504 | + | |
481 | 505 | | |
482 | 506 | | |
483 | | - | |
484 | | - | |
| 507 | + | |
| 508 | + | |
485 | 509 | | |
486 | 510 | | |
487 | 511 | | |
| |||
0 commit comments