dnp3: fix signed integer overflow

By using unsigned integers everywhere
pull/5627/head
Philippe Antoine 4 years ago committed by Victor Julien
parent ea0936199d
commit 001350547a

@ -354,15 +354,15 @@ static int DNP3DecodeObjectG{{object.group}}V{{object.variation}}(const uint8_t
DNP3PointList *points)
{
DNP3ObjectG{{object.group}}V{{object.variation}} *object = NULL;
int bytes = (count / 8) + 1;
uint32_t bytes = (count / 8) + 1;
uint32_t prefix = 0;
int point_index = start;
uint32_t point_index = start;
if (!DNP3ReadPrefix(buf, len, prefix_code, &prefix)) {
goto error;
}
for (int i = 0; i < bytes; i++) {
for (uint32_t i = 0; i < bytes; i++) {
uint8_t octet;

Loading…
Cancel
Save