[core] FIX: Added check for NULL unit when passing to updateConnStatus #2028
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2027
Fixed a problem: when
getNextAvailableUnit
returns NULL, the packet is read temporarily and dropped, as there's no possible storage where it could land. The problem is, however, that this packet's data were also necessary in some of the subprocedures inupdateConnStatus
and therefore it was being accessed (which was new towards UDT, and it's related to some bugfixes and additional data access necessity in case of HSv5).The fix: the socket ID is pre-extracted (with fallback to 0 in case of lack of extracted unit) and wherever a packet is required to be accessed, a check for NULL is added, as well as a NULL pointer to a packet is now acceptable (replaced reference).