Skip to content

Commit

Permalink
CID 470571 fix
Browse files Browse the repository at this point in the history
fixed a Coverity bug
  • Loading branch information
MartinPulec committed Jan 7, 2025
1 parent 40f7bb7 commit 8bf32c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rtp/net_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

#include <pthread.h>
#include <stdalign.h>
#include <stdint.h> // for uint16_t, uintmax_t

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

0 comments on commit 8bf32c3

Please sign in to comment.