HttpAuthentication: Check LockBuffer() success...

... in _H() MD5 digest method. Thanks to axeld
for the suggestion.
This commit is contained in:
Stephan Aßmus
2014-06-05 21:43:35 +02:00
parent f0e21afe06
commit 16b8886a59
@@ -381,6 +381,9 @@ BHttpAuthentication::_H(const BString& value) const
BString result;
// Preallocate the string
char* resultChar = result.LockBuffer(MD5_DIGEST_LENGTH * 2);
if (resultChar == NULL)
return BString();
for (int i = 0; i < MD5_DIGEST_LENGTH; i++) {
char c = ((hashResult[i] & 0xF0) >> 4);
c += (c > 9) ? 'a' - 10 : '0';