hrev47317 adds 1 changeset to branch 'master' old head: f0e21afe06e1cca29af8944adc6428a7a41bef1d new head: 16b8886a598b35fd4dc6539f5086edc3dd07c9c9 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=16b8886+%5Ef0e21af ---------------------------------------------------------------------------- 16b8886: HttpAuthentication: Check LockBuffer() success... ... in _H() MD5 digest method. Thanks to axeld for the suggestion. [ Stephan Aßmus <superstippi@xxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev47317 Commit: 16b8886a598b35fd4dc6539f5086edc3dd07c9c9 URL: http://cgit.haiku-os.org/haiku/commit/?id=16b8886 Author: Stephan Aßmus <superstippi@xxxxxx> Date: Thu Jun 5 19:42:20 2014 UTC ---------------------------------------------------------------------------- 1 file changed, 3 insertions(+) src/kits/network/libnetapi/HttpAuthentication.cpp | 3 +++ ---------------------------------------------------------------------------- diff --git a/src/kits/network/libnetapi/HttpAuthentication.cpp b/src/kits/network/libnetapi/HttpAuthentication.cpp index f5df650..e6840c7 100644 --- a/src/kits/network/libnetapi/HttpAuthentication.cpp +++ b/src/kits/network/libnetapi/HttpAuthentication.cpp @@ -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';