From fd043d0c969043a81ad25c76835b85c739c9c5c4 Mon Sep 17 00:00:00 2001 From: "amit@chromium.org" Date: Fri, 11 Feb 2011 21:41:17 +0000 Subject: Fix *RegValueWorkItem to handle a case where previous value is empty. Not handling correctly caused a crash. Added unit tests to cover those cases. BUG=71953 TEST=covered by installer util unit tests Review URL: http://codereview.chromium.org/6485026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74675 0039d316-1c4b-4281-b951-d872f2087c98 --- base/win/registry.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base') diff --git a/base/win/registry.cc b/base/win/registry.cc index 09cf485..d105a4c 100644 --- a/base/win/registry.cc +++ b/base/win/registry.cc @@ -218,7 +218,7 @@ LONG RegKey::ReadInt64(const wchar_t* name, int64* value) const { LONG RegKey::WriteValue(const wchar_t* name, const void * data, DWORD dsize, DWORD dtype) { base::ThreadRestrictions::AssertIOAllowed(); - DCHECK(data); + DCHECK(data || !dsize); LONG result = RegSetValueEx(key_, name, 0, dtype, reinterpret_cast(const_cast(data)), dsize); -- cgit v1.1