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

crash in hdf_copy if src==NULL #9

Open
GoogleCodeExporter opened this issue Nov 15, 2015 · 3 comments
Open

crash in hdf_copy if src==NULL #9

GoogleCodeExporter opened this issue Nov 15, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

patch:

=====
static NEOERR * _copy_nodes (HDF *dest, HDF *src)
{
  NEOERR *err = STATUS_OK;
  HDF *dt, *st;
  HDF_ATTR *attr_copy;

+  if (src == NULL)
+    return STATUS_OK;
  st = src->child;
  while (st != NULL)
  {
    err = _copy_attr(&attr_copy, st->attr);
=====

Original issue reported on code.google.com by [email protected] on 26 Sep 2012 at 11:48

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

I think this is an error of end-user, not of clearsilver.

Documentation for hdf_copy says:
"hdf_copy is a deep copy of an HDF tree pointed to by
src to the named node of dest. dest and src need not be
part of the same data set"

there isnt something like "if src is NULL, ..."

Original comment by [email protected] on 8 Dec 2012 at 8:08

@GoogleCodeExporter
Copy link
Author

If all other functions, if src is NULL - function does nothing and returns, and 
only in hdf_copy application crashed in NULL pointer dereference handler.
I think it should be consistent with other functions - if source is NULL, do 
nothing.

Original comment by [email protected] on 14 Dec 2012 at 7:36

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

1 participant