Cleanup: eliminate implicit sign-extension
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 4 Sep 2015 05:43:31 +0000 (01:43 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 4 Sep 2015 05:43:31 +0000 (01:43 -0400)
commit4c5dac0d3db2e2e6daef2f5e137abc2e93ed0302
tree8af21cbad4dd7f2df99e3ff37f84982afe486e1a
parent5ada26b49f63b2c4f9e4e01aba69f9fb9e935c4f
Cleanup: eliminate implicit sign-extension

Coverity reported:

CID 1321723 (#1 of 1): Unintended sign extension
(SIGN_EXTENSION)sign_extension: Suspicious implicit sign extension:
elf->ehdr->e_shentsize with type unsigned short (16 bits, unsigned) is
promoted in index * elf->ehdr->e_shentsize to type int (32 bits,
signed), then sign-extended to type unsigned long (64 bits, unsigned).
If index * elf->ehdr->e_shentsize is greater than 0x7FFFFFFF, the upper
bits of the result will all be 1.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-elf.c
This page took 0.029105 seconds and 5 git commands to generate.