diff --git a/CHANGES.md b/CHANGES.md index f158154..976154a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # CHANGES +## 1.13.8 + +* Use gzputs instead of gzprintf when writing reference contig lines to avoid buffer overflow + ## 1.13.7 * Modify means by which zlib version is detected. diff --git a/Makefile b/Makefile index 3dfc138..66e8ed3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CAVEMAN_VERSION=1.13.7 +CAVEMAN_VERSION=1.13.8 TEST_REF?="" #Compiler CC?=gcc diff --git a/src/output.c b/src/output.c index bb18bed..31e6ba6 100644 --- a/src/output.c +++ b/src/output.c @@ -298,7 +298,7 @@ int output_vcf_header(gzFile out, char *tum_bam, char *norm_bam, char *ref_seq_l //Add reference sequence headers contigs = output_generate_reference_contig_lines(tum_bam, assembly, species); check(contigs != NULL,"Error fetching contigs from bam file."); - write = gzprintf(out,"%s",contigs); + write = gzputs(out,contigs); check(write==sizeof(char)*strlen(contigs),"Error (%d) writing contigs.",write); //INFO lines