[Debian-med-packaging] Bug#770162: htslib: fai_build_core in faidx.c assumes char is signed

Edmund Grimley Evans edmund.grimley.evans at gmail.com
Wed Nov 19 09:50:18 UTC 2014


Source: htslib
Version: 1.1-1

The code looks like this:

faidx_t *fai_build_core(BGZF *bgzf)
{
    char c, *name;
...
    while ( (c=bgzf_getc(bgzf))>=0 ) {

Clearly on architectures where plain char is unsigned (arm64, armhf,
...) this won't work (infinite loop).

I'd suggest changing the type of c from char to int, which is the return
type of bgzf_getc.

This bug is apparently the cause of samtools failing to build:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762647

I can't take credit for identifying the issue as domibel seems to have
announced it here on Oct 2:

http://github.com/samtools/samtools/issues/304



More information about the Debian-med-packaging mailing list