2012-08-07 17:22:31 |
Paul Thomson |
description |
In pbzip2.cpp, the fileData pointer below is not initialized:
void *consumer (void *q)
{
queue *fifo;
// char *FileData = NULL;
outBuff *fileData;
...
if (!fifo->empty && (fifo->remove(fileData) == 1))
...
It is then passed to the remove function, in pbzip2.h, around line 210:
int remove(ElementTypePtr & element)
{
...
#ifdef PBZIP_DEBUG
...
if (element != NULL)
{
...
(int)element->isLastInSequence, ...
...
}
#endif
if ( (element != NULL) && !element->isLastInSequence )
...
where it is dereferenced if it is not NULL.
I believe the pointer should be initialized to NULL.
Thanks. |
In pbzip2.cpp, the fileData pointer below is not initialized:
void *consumer (void *q)
{
queue *fifo;
// char *FileData = NULL;
outBuff *fileData;
...
if (!fifo->empty && (fifo->remove(fileData) == 1))
...
It is then passed to the remove function, which is defined in pbzip2.h, around line 210:
int remove(ElementTypePtr & element)
{
...
#ifdef PBZIP_DEBUG
...
if (element != NULL)
{
...
(int)element->isLastInSequence, ...
...
}
#endif
if ( (element != NULL) && !element->isLastInSequence )
...
where it is dereferenced if it is not NULL.
I believe the pointer should be initialized to NULL.
Thanks. |
|