diff --git a/src/kits/network/libnetapi/HttpAuthentication.cpp b/src/kits/network/libnetapi/HttpAuthentication.cpp index f5df650865..e6840c771c 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';