Blame SOURCES/0001-glu-initialize-PriorityQ-order-field-to-NULL-in-pqNe.patch

46119b
From bfdf99d6ff64b9c2d840e8a5767eaa57e4363c79 Mon Sep 17 00:00:00 2001
46119b
From: Mike Gorchak <mike.gorchak.qnx@gmail.com>
46119b
Date: Wed, 2 Jan 2013 13:39:50 -0700
46119b
Subject: [PATCH 1/2] glu: initialize PriorityQ::order field to NULL in
46119b
 pqNewPriorityQ()
46119b
46119b
pqNewPriorityQ() function creates and setups PriorityQ structure, all
46119b
except for the field "order". It is filled later in function
46119b
pqInit(). Depending on vertices of polygon which must be tesselated
46119b
there possible following situation, pqDeletePriorityQ() is called
46119b
right after pqNewPriorityQ() function. pqNewPriorityQ() tries to free
46119b
memory using pq->order as pointer, which is unitialized at this point.
46119b
46119b
Signed-off-by: Brian Paul <brianp@vmware.com>
46119b
---
46119b
 src/libtess/priorityq.c | 1 +
46119b
 1 file changed, 1 insertion(+)
46119b
46119b
diff --git a/src/libtess/priorityq.c b/src/libtess/priorityq.c
46119b
index c6b99cc..db7cd59 100644
46119b
--- a/src/libtess/priorityq.c
46119b
+++ b/src/libtess/priorityq.c
46119b
@@ -65,6 +65,7 @@ PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) )
46119b
      return NULL;
46119b
   }
46119b
 
46119b
+  pq->order = NULL;
46119b
   pq->size = 0;
46119b
   pq->max = INIT_SIZE;
46119b
   pq->initialized = FALSE;
46119b
-- 
46119b
1.8.3.1
46119b