mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 1034916 - Remove dangerous public destructor of nsUTF8ConverterService. r=ehsan
This commit is contained in:
parent
23cdfd9cc2
commit
e6ff458e86
@ -9,22 +9,14 @@
|
||||
|
||||
//==============================================================
|
||||
|
||||
class nsUTF8ConverterService;
|
||||
|
||||
namespace mozilla {
|
||||
template<>
|
||||
struct HasDangerousPublicDestructor<nsUTF8ConverterService>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
}
|
||||
|
||||
class nsUTF8ConverterService: public nsIUTF8ConverterService {
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIUTF8CONVERTERSERVICE
|
||||
|
||||
public:
|
||||
nsUTF8ConverterService() {}
|
||||
|
||||
private:
|
||||
virtual ~nsUTF8ConverterService() {}
|
||||
};
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "nsCookie.h"
|
||||
#include "nsUTF8ConverterService.h"
|
||||
#include <stdlib.h>
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
/******************************************************************************
|
||||
* nsCookie:
|
||||
@ -80,9 +81,9 @@ nsCookie::Create(const nsACString &aName,
|
||||
{
|
||||
// Ensure mValue contains a valid UTF-8 sequence. Otherwise XPConnect will
|
||||
// truncate the string after the first invalid octet.
|
||||
nsUTF8ConverterService converter;
|
||||
nsRefPtr<nsUTF8ConverterService> converter = new nsUTF8ConverterService();
|
||||
nsAutoCString aUTF8Value;
|
||||
converter.ConvertStringToUTF8(aValue, "UTF-8", false, true, 1, aUTF8Value);
|
||||
converter->ConvertStringToUTF8(aValue, "UTF-8", false, true, 1, aUTF8Value);
|
||||
|
||||
// find the required string buffer size, adding 4 for the terminating nulls
|
||||
const uint32_t stringLength = aName.Length() + aUTF8Value.Length() +
|
||||
|
Loading…
x
Reference in New Issue
Block a user