Skip to content
Snippets Groups Projects
Commit 55d7bef5 authored by Rob Davies's avatar Rob Davies
Browse files

Fix gcc 8.1 warnings

Change kputsn() and kputsn_() to take size_t instead ot int to
fix possible integer overflow in kputs.  They are both static inline
so we can do this without breaking the ABI.  Guards on integer
wrap-around should catch attempts to add over- or negatively- long
strings.

Possible buffer overflow in cram_populate_ref().

Possible use of uninitialised value in bcf_sr_regions_next().  In
that function it is possible that `from` and `to` may not be set if
either `ifrom` or `ito` is negative as that could cause
_regions_parse_line() to skip setting them.

String truncation warning in bam_hdr_write() when compiled with
no optimisation.  There was no need to copy the string anyway,
it can just be written out directly.

Not caught by gcc: Possible overflow in expand_cache_path().

Silence false positive uninitialised value warning in cram_encode.c
process_one_read() when using optimisation -Og or -Os.  gcc fails
to spot that `new = 1` prevents `k` from being used if not set.
parent bceff25a
Branches
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment