Re: [PATCH] mingw: consider that UNICODE_STRING::Length counts bytes
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 20, 2016, 15:16 UTC
- Message-ID
- <alpine.DEB.2.20.1612201610270.54750@virtualbox>
- In-Reply-To
- <1482183120-21592-1-git-send-email-max@max630.net>
Hi Max,
On Mon, 19 Dec 2016, Max Kirillov wrote:
> UNICODE_STRING::Length field means size of buffer in bytes[1], despite > of buffer itself being array of wchar_t. Because of that terminating > zero is placed twice as far. Fix it.
This commit message needs to be wrapped at <= 76 columns per row.
Show 8 quoted lines
> [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa380518.aspx > > Signed-off-by: Max Kirillov <max@max630.net> > --- > Access outside of buffer was very unlikely (for that user needed to redirect > standard fd to a file with path longer than ~250 symbols), it still did not > seem to do any harm, and otherwise it did not break because only substring is > checked, but it was still incorrect.
Very good, thank you for fixing my mistake! I verified locally that it does exactly the right thing with your patch.
ACK, Dscho