pbzip 1.1.6 uninitialized pointer

Bug #1034073 reported by Paul Thomson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pbzip2
Fix Released
Undecided
Unassigned

Bug 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, 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.

Paul Thomson (pault543)
description: updated
Changed in pbzip2:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.