Fix a double-free while performing print operations which could trigger a

segmentation fault if malloc debugging was enabled.

Reported by:	dougb
This commit is contained in:
Joe Marcus Clarke 2006-12-15 20:57:41 +00:00
parent 10cb456d1a
commit 043a907e62
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=179876
18 changed files with 243 additions and 3 deletions

View file

@ -8,6 +8,7 @@
PORTNAME= thunderbird
DISTVERSION= 1.5.0.8
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_MOZILLA_EXTENDED}
MASTER_SITE_SUBDIR= thunderbird/releases/${DISTVERSION}/source

View file

@ -0,0 +1,26 @@
--- gfx/src/ps/nsFontMetricsPS.cpp.orig Fri Dec 15 01:42:25 2006
+++ gfx/src/ps/nsFontMetricsPS.cpp Fri Dec 15 01:41:20 2006
@@ -1037,8 +1037,10 @@ nsFontPSXft::Init(nsXftEntry* aEntry,
nsFontPSXft::~nsFontPSXft()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;
@@ -2327,8 +2329,10 @@ nsXftType1Generator::Init(nsXftEntry* aE
nsXftType1Generator::~nsXftType1Generator()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;

View file

@ -8,6 +8,7 @@
PORTNAME= thunderbird
DISTVERSION= 1.5.0.8
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_MOZILLA_EXTENDED}
MASTER_SITE_SUBDIR= thunderbird/releases/${DISTVERSION}/source

View file

@ -0,0 +1,26 @@
--- gfx/src/ps/nsFontMetricsPS.cpp.orig Fri Dec 15 01:42:25 2006
+++ gfx/src/ps/nsFontMetricsPS.cpp Fri Dec 15 01:41:20 2006
@@ -1037,8 +1037,10 @@ nsFontPSXft::Init(nsXftEntry* aEntry,
nsFontPSXft::~nsFontPSXft()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;
@@ -2327,8 +2329,10 @@ nsXftType1Generator::Init(nsXftEntry* aE
nsXftType1Generator::~nsXftType1Generator()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;

View file

@ -8,6 +8,7 @@
PORTNAME= thunderbird
DISTVERSION= 1.5.0.8
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_MOZILLA_EXTENDED}
MASTER_SITE_SUBDIR= thunderbird/releases/${DISTVERSION}/source

View file

@ -0,0 +1,26 @@
--- gfx/src/ps/nsFontMetricsPS.cpp.orig Fri Dec 15 01:42:25 2006
+++ gfx/src/ps/nsFontMetricsPS.cpp Fri Dec 15 01:41:20 2006
@@ -1037,8 +1037,10 @@ nsFontPSXft::Init(nsXftEntry* aEntry,
nsFontPSXft::~nsFontPSXft()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;
@@ -2327,8 +2329,10 @@ nsXftType1Generator::Init(nsXftEntry* aE
nsXftType1Generator::~nsXftType1Generator()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;

View file

@ -7,7 +7,7 @@
PORTNAME= firefox
DISTVERSION= 2.0
PORTREVISION= 2
PORTREVISION= 3
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA_EXTENDED}

View file

@ -0,0 +1,26 @@
--- gfx/src/ps/nsFontMetricsPS.cpp.orig Fri Dec 15 01:42:25 2006
+++ gfx/src/ps/nsFontMetricsPS.cpp Fri Dec 15 01:41:20 2006
@@ -1037,8 +1037,10 @@ nsFontPSXft::Init(nsXftEntry* aEntry,
nsFontPSXft::~nsFontPSXft()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;
@@ -2327,8 +2329,10 @@ nsXftType1Generator::Init(nsXftEntry* aE
nsXftType1Generator::~nsXftType1Generator()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;

View file

@ -7,7 +7,7 @@
PORTNAME= firefox
DISTVERSION= 2.0
PORTREVISION= 2
PORTREVISION= 3
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA_EXTENDED}

View file

@ -0,0 +1,26 @@
--- gfx/src/ps/nsFontMetricsPS.cpp.orig Fri Dec 15 01:42:25 2006
+++ gfx/src/ps/nsFontMetricsPS.cpp Fri Dec 15 01:41:20 2006
@@ -1037,8 +1037,10 @@ nsFontPSXft::Init(nsXftEntry* aEntry,
nsFontPSXft::~nsFontPSXft()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;
@@ -2327,8 +2329,10 @@ nsXftType1Generator::Init(nsXftEntry* aE
nsXftType1Generator::~nsXftType1Generator()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;

View file

@ -7,6 +7,7 @@
PORTNAME= firefox
DISTVERSION= 1.5.0.8
PORTREVISION= 1
PORTEPOCH= 2
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA_EXTENDED}

View file

@ -0,0 +1,26 @@
--- gfx/src/ps/nsFontMetricsPS.cpp.orig Fri Dec 15 01:42:25 2006
+++ gfx/src/ps/nsFontMetricsPS.cpp Fri Dec 15 01:41:20 2006
@@ -1037,8 +1037,10 @@ nsFontPSXft::Init(nsXftEntry* aEntry,
nsFontPSXft::~nsFontPSXft()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;
@@ -2327,8 +2329,10 @@ nsXftType1Generator::Init(nsXftEntry* aE
nsXftType1Generator::~nsXftType1Generator()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;

View file

@ -7,7 +7,7 @@
PORTNAME= firefox
DISTVERSION= 2.0
PORTREVISION= 2
PORTREVISION= 3
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA_EXTENDED}

View file

@ -0,0 +1,26 @@
--- gfx/src/ps/nsFontMetricsPS.cpp.orig Fri Dec 15 01:42:25 2006
+++ gfx/src/ps/nsFontMetricsPS.cpp Fri Dec 15 01:41:20 2006
@@ -1037,8 +1037,10 @@ nsFontPSXft::Init(nsXftEntry* aEntry,
nsFontPSXft::~nsFontPSXft()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;
@@ -2327,8 +2329,10 @@ nsXftType1Generator::Init(nsXftEntry* aE
nsXftType1Generator::~nsXftType1Generator()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;

View file

@ -8,6 +8,7 @@
PORTNAME= seamonkey
DISTVERSION= 1.0.6
PORTREVISION= 1
CATEGORIES?= www
MASTER_SITES= ${MASTER_SITE_MOZILLA_EXTENDED}
MASTER_SITE_SUBDIR= seamonkey/releases/${DISTVERSION}

View file

@ -0,0 +1,26 @@
--- gfx/src/ps/nsFontMetricsPS.cpp.orig Fri Dec 15 01:42:25 2006
+++ gfx/src/ps/nsFontMetricsPS.cpp Fri Dec 15 01:41:20 2006
@@ -1037,8 +1037,10 @@ nsFontPSXft::Init(nsXftEntry* aEntry,
nsFontPSXft::~nsFontPSXft()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;
@@ -2327,8 +2329,10 @@ nsXftType1Generator::Init(nsXftEntry* aE
nsXftType1Generator::~nsXftType1Generator()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;

View file

@ -8,6 +8,7 @@
PORTNAME= seamonkey
DISTVERSION= 1.0.6
PORTREVISION= 1
CATEGORIES?= www
MASTER_SITES= ${MASTER_SITE_MOZILLA_EXTENDED}
MASTER_SITE_SUBDIR= seamonkey/releases/${DISTVERSION}

View file

@ -0,0 +1,26 @@
--- gfx/src/ps/nsFontMetricsPS.cpp.orig Fri Dec 15 01:42:25 2006
+++ gfx/src/ps/nsFontMetricsPS.cpp Fri Dec 15 01:41:20 2006
@@ -1037,8 +1037,10 @@ nsFontPSXft::Init(nsXftEntry* aEntry,
nsFontPSXft::~nsFontPSXft()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;
@@ -2327,8 +2329,10 @@ nsXftType1Generator::Init(nsXftEntry* aE
nsXftType1Generator::~nsXftType1Generator()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;