Skip to content

Commit

Permalink
lib: fix signed overflow warning in nl_object_diff()
Browse files Browse the repository at this point in the history
Coverity warns "Signed integer overflow for expression '1<<31'".
  • Loading branch information
thom311 committed Dec 1, 2023
1 parent 57e0170 commit aea3f9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ uint32_t nl_object_diff(struct nl_object *a, struct nl_object *b)
diff = nl_object_diff64(a, b);

return (diff & ~((uint64_t) 0xFFFFFFFF))
? (uint32_t) diff | (1 << 31)
? (uint32_t) diff | (((uint32_t ) 1u) << 31)
: (uint32_t) diff;
}

Expand Down

0 comments on commit aea3f9f

Please sign in to comment.