Skip to content

Commit

Permalink
check to avoid division by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Aug 1, 2023
1 parent c6f68f2 commit 5ea215d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/ReadHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,12 @@ CHIP_ERROR ReadHandler::ProcessSubscribeRequest(System::PacketBufferHandle && aP

// GetPublisherSelectedIntervalLimit() returns the IdleModeInterval if the device is an ICD
uint32_t decidedMaxInterval = GetPublisherSelectedIntervalLimit();

// Check if the PublisherSelectedIntervalLimit is 0. If so, set decidedMaxInterval to MaxIntervalCeiling
if(decidedMaxInterval == 0)
{
decidedMaxInterval = mMaxInterval;
}

// If requestedMinInterval is greater than the IdleTimeInterval, select next active up time as max interval
if (mMinIntervalFloorSeconds > decidedMaxInterval)
Expand Down

0 comments on commit 5ea215d

Please sign in to comment.