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

Error in SplineWorkspace #9694

Closed
mantid-builder opened this issue Feb 3, 2014 · 2 comments
Closed

Error in SplineWorkspace #9694

mantid-builder opened this issue Feb 3, 2014 · 2 comments
Assignees
Labels
Framework Issues and pull requests related to components in the Framework High Priority An issue or pull request that if not addressed is severe enough to postponse a release.
Milestone

Comments

@mantid-builder
Copy link
Collaborator

Original Reporter: Russell Taylor

The following code in SplineWorkspace.cpp (starting at line 88) came to my attention because coverity scan complained about dereferencing a null pointer:

  double* yValues(0);
  m_cspline->derivative1D(yValues, xValues, nData, 2);
  for(size_t i=0;i<nData;i++)
  {
    out->set(i,0,1.);
    out->set(i,1,xValues[i]);
    out->set(i,2,yValues[i]);
  }

yValues needs to be an array, but is not declared as such. The best approach here would be to declare it as a local std::vector and then pass its address to derivative1D.

Also, this class is lacking a unit test, which surely would have picked up this mistake.

Finally, calling a class *Workspace when it's a function is confusing! Could you come up with an alternative name please?

@mantid-builder
Copy link
Collaborator Author

This issue was originally trac ticket 8850

@mantid-builder
Copy link
Collaborator Author

@mantid-builder mantid-builder added High Priority An issue or pull request that if not addressed is severe enough to postponse a release. Framework Issues and pull requests related to components in the Framework labels Jun 3, 2015
@mantid-builder mantid-builder added this to the Release 3.2 milestone Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues and pull requests related to components in the Framework High Priority An issue or pull request that if not addressed is severe enough to postponse a release.
Projects
None yet
Development

No branches or pull requests

2 participants