Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null pointer dereferencing #382

Closed
gcode-importer opened this issue Aug 24, 2014 · 2 comments
Closed

Null pointer dereferencing #382

gcode-importer opened this issue Aug 24, 2014 · 2 comments

Comments

@gcode-importer
Copy link

Originally reported on Google Code with ID 382

see http://www.viva64.com/en/b/0271/#ID0EWAAG

bool j2k_write_rgn(....)
{
  OPJ_BYTE * l_current_data = 00;
  OPJ_UINT32 l_nb_comp;
  OPJ_UINT32 l_rgn_size;
  opj_image_t *l_image = 00;
  opj_cp_t *l_cp = 00;
  opj_tcp_t *l_tcp = 00;
  opj_tccp_t *l_tccp = 00;
  OPJ_UINT32 l_comp_room;

  // preconditions
  assert(p_j2k != 00);
  assert(p_manager != 00);
  assert(p_stream != 00);

  l_cp = &(p_j2k->m_cp);
  l_tcp = &l_cp->tcps[p_tile_no];
  l_tccp = &l_tcp->tccps[p_comp_no];

  l_nb_comp = l_image->numcomps;
  ....
}

PVS-Studio's diagnostic message: V522 Dereferencing of the null pointer 'l_image' might
take place. j2k.c 5205

The 'l_image' pointer is initialized to zero and is not changed anywhere after that.
So, when calling the j2k_write_rgn() function, the null pointer will be dereferenced.

Reported by detonin on 2014-08-24 21:00:25

@gcode-importer
Copy link
Author

No archive found. Must be very old.

winfried

Reported by szukw000 on 2014-08-30 00:48:27

@gcode-importer
Copy link
Author

indeed.

Reported by detonin on 2014-09-30 12:19:34

  • Status changed: Invalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants