Fix undefined behaviour: shifting signed int by 31 place
see #465 #0 0x555719469ec5 in AddAnyPortMapping.cfi /home/ryutaroh/miniupnpd-1018/miniupnp/miniupnpd/upnpsoap.c:703:42 #1 0x5557194705a7 in ExecuteSoapAction /home/ryutaroh/miniupnpd-1018/miniupnp/miniupnpd/upnpsoap.c:2335:5 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior upnpsoap.c:703:42 in
This commit is contained in:
parent
92ff8a6a7e
commit
90259ae803
|
@ -700,7 +700,7 @@ AddAnyPortMapping(struct upnphttp * h, const char * action, const char * ns)
|
|||
} else {
|
||||
eport = ++eport_above;
|
||||
}
|
||||
if (!(allowed_eports[eport / 32] & (1 << eport % 32)))
|
||||
if (!(allowed_eports[eport / 32] & ((uint32_t)1U << (eport % 32))))
|
||||
continue; /* not allowed */
|
||||
r = upnp_redirect(r_host, eport, int_ip, iport, protocol, desc, leaseduration);
|
||||
if (r == 0 || r == -1) {
|
||||
|
|
Loading…
Reference in New Issue