Skip to content

Commit

Permalink
Merge pull request #5359 from larsewi/interface-3.21.x
Browse files Browse the repository at this point in the history
Fixed infinite loop on error bug while reading interface exception file (3.21.x)
  • Loading branch information
larsewi authored Nov 3, 2023
2 parents 91ba466 + 0ef208d commit 6290c2a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libenv/unix_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,15 @@ static void InitIgnoreInterfaces()
while (!feof(fin))
{
regex[0] = '\0';
int scanCount = fscanf(fin,"%255s",regex);
int scanCount = fscanf(fin, "%255s", regex);
if (ferror(fin) != 0)
{
Log(LOG_LEVEL_ERR,
"Failed to read interface exception file %s: %s",
filename,
GetErrorStr());
break;
}

if (scanCount != 0 && *regex != '\0')
{
Expand Down

0 comments on commit 6290c2a

Please sign in to comment.