Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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
  • Loading branch information
jnpkrn committed May 13, 2016
commit c49d83c2d0b747a435ef675f64841d2532e06896
2 changes: 1 addition & 1 deletion src/inline-fn.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@



inline static uint32_t get_local_id(void)
inline static int get_local_id(void)
{
return local ? local->site_id : -1;
}
Expand Down