HomeClusterLabs Projects
Diffusion Booth c49d83c2d0b7

Med: get_local_id: denoopize dependent condition (signedness issue)

Description

Med: get_local_id: denoopize dependent condition (signedness issue)

Otherwise, condition in booth_tcp_init (src/transport.c):

if (get_local_id() < 0)

		return -1;

could never be triggered. It should not be triggered anyway at the
current state, but try to stay sane no matter what, especially if
the issue was hidden in such a nasty way. Also note that using "int"
should be pretty much fine as precautions are taken in add_site
so as to keep MSB unset for site IDs in use, which is sufficient
to distinguish them from a signalling negative value.

Discovered-by: static analysis/Coverity

Details

Provenance
Jan Pokorný <jpokorny@redhat.com>Authored on May 13 2016, 11:34 AM
Parents
rBfd90d7cf7548: Med: format_peers: fix a memleak in case of buffer too small
Branches
Unknown
Tags
Unknown

Event Timeline