Skip to content

Commit 8bf32c3

Browse files
committed
CID 470571 fix
fixed a Coverity bug
1 parent 40f7bb7 commit 8bf32c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rtp/net_udp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
#include <pthread.h>
5252
#include <stdalign.h>
53+
#include <stdint.h> // for uint16_t, uintmax_t
5354

5455
#ifndef _WIN32
5556
#include <ifaddrs.h>
@@ -932,7 +933,7 @@ get_ifindex(const char *iface)
932933
// check if the value isn't the index itself
933934
char *endptr = NULL;
934935
const long val = strtol(iface, &endptr, 0);
935-
if (*endptr == '\0' && val >= 0 && (unsigned) val <= UINT_MAX) {
936+
if (*endptr == '\0' && val >= 0 && (uintmax_t) val <= UINT_MAX) {
936937
char buf[IF_NAMESIZE];
937938
if (if_indextoname(val, buf) != NULL) {
938939
MSG(INFO, "Using mcast interface %s\n", buf);

0 commit comments

Comments
 (0)