You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Companion to samtools/htslib#1816, which among other things adds
printf format checking attributes to bcf_hdr_printf(). This fixes
a few places that could trigger warnings in bcftools as a result
of that change. It also adds checking for some functions internal
to bcftools so `clang -Wformat -Wformat=2` works and fixes a couple
of bugs that were found as a result.
Bugs fixed:
* In open_file() a user-controlled string was passed as the format
to mkdir_p(), which could lead to information leakage or
possibly arbitrary writes via a crafted file path name.
* Use of wrong type for position in vcfsort sort_blocks() error report.
* Printing the wrong variable in vcfsort do_partial_merge() error report.
The -Wformat=2 option disallows non-literals in printf-like
functions, which can be a little difficult to work around. Here
most cases were fairly easy to sort out, apart from hdr_append()
in plugins/fill-tags.c. For that the chosen solution was to
convert the function into a macro. While not particularly nice it
does allow all of the format strings passed in to be validated
properly.
Adds Wformat to clang CI build to catch any future regressions.
0 commit comments