mirror of
https://github.com/nmap/nmap.git
synced 2025-12-20 22:49:01 +00:00
Cast literal to appropriate type
On 64-bit, the literal 1 is a 32-bit integer, and can't be shifted by the appropriate amount (61 bits).
This commit is contained in:
@@ -395,7 +395,7 @@ nsock_event_id get_new_event_id(mspool *ms, enum nse_type type) {
|
|||||||
assert(type < NSE_TYPE_MAX);
|
assert(type < NSE_TYPE_MAX);
|
||||||
|
|
||||||
shiftbits = sizeof(nsock_event_id) * 8 - TYPE_CODE_NUM_BITS;
|
shiftbits = sizeof(nsock_event_id) * 8 - TYPE_CODE_NUM_BITS;
|
||||||
max_serial_allowed = (1 << shiftbits) - 1;
|
max_serial_allowed = ((unsigned long)1 << shiftbits) - 1;
|
||||||
if (serial == max_serial_allowed) {
|
if (serial == max_serial_allowed) {
|
||||||
/* then the next serial will be one because 0 is forbidden */
|
/* then the next serial will be one because 0 is forbidden */
|
||||||
ms->next_event_serial = 1;
|
ms->next_event_serial = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user