-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net_imap: Prevent invalid memory accesses due to stale pointer.
A variety of memory faults can occur due to imap->client being "stale", i.e. left pointing to an imap_client that has been destroyed and freed. This change is threefold: * When clients are destroyed, check if the client's IMAP session's current remote client is that client. If so, set this pointer to NULL. Not doing this will almost certainly lead to future invalid memory accesses because that pointer will point to a client that no longer exists. This ensures the pointer cannot be stale, even if for whatever reason it is still the current client at destroy time. * Add code to explicitly check the integrity and validity of critical pointers. This code is not necessary if the code is bug-free, but was useful in narrowing down the cause of these memory-related crashes, so is being left in for future debugging use if needed (but disabled, as it is not needed for anything at the moment). * Now that this bug has been identified and fixed, turn a soft assertion in remote_status back into the hard assertion that it was originally. LBBS-21 #close LBBS-73 #close
- Loading branch information
1 parent
cf85c5d
commit d86994c
Showing
4 changed files
with
76 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters