forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly handle zero-byte NTLM buffer writes
r558579 changed the backing store of NTLM writes from being a std::basic_string<uint8_t> to a std::vector<uint8_t>, to better align with its purpose. This change had the effect of causing .data() to now return nullptr when .size() == 0, rather than the previous behaviour, in which .data() would return a 1-byte buffer that was a NUL ('\0') terminator - the consequence of using std::basic_string<>. This had the effect on writes which expected zero-byte writes (aka no-ops) to succeed, in that GetBufferPtr() now returned nullptr, rather than a valid pointer. Since zero-byte memcpys immediately follow, this needs to be explicitly handled, as memcpy() requires both pointers be valid, even for zero-byte writes. BUG=843066 Change-Id: I9ff8f825469142da31abc866c81f0418ae25f93f Reviewed-on: https://chromium-review.googlesource.com/1059449 Commit-Queue: Ryan Sleevi <[email protected]> Reviewed-by: Asanka Herath <[email protected]> Cr-Commit-Position: refs/heads/master@{#558812}
- Loading branch information
Showing
4 changed files
with
82 additions
and
5 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