Skip to content
Snippets Groups Projects
Commit 1344fb86 authored by Eduardo Rodrigues's avatar Eduardo Rodrigues
Browse files

Merge branch 'cherry-pick-963e6a8c' into 'run2-patches'

Fix write beyond array bound

See merge request !506
parents 6806cdde 84e753e7
No related branches found
No related tags found
6 merge requests!1039Fixed formatting,!1000Fixed formatting,!864Fix crash in TupleToolHerschel when multiple versions are present,!557Fixed warnings,!544WIP: Modification of BkgCat behaviour to not throw exception,!506Fix write beyond array bound
......@@ -198,7 +198,8 @@ warning()<< m_MergedPizerosLocation << " Not available"<<endmsg;
verbose() << "Filling variables with conesize " << coneSize << endmsg;
// -- Convert the conesize to a string
char coneNumber[4];
// -- Convert the conesize to a string (and don't forget space for the terminating '\0'!)
char coneNumber[5];
sprintf( coneNumber, "%.2f", coneSize );
std::string conesize( coneNumber );
......
......@@ -133,8 +133,8 @@ StatusCode TupleToolTrackIsolation::fill( const LHCb::Particle *top,
double deltaPhi = fabs(part->momentum().Phi() - momentumInCone.Phi());
if(deltaPhi > M_PI) deltaPhi = 2*M_PI-deltaPhi;
// -- Convert the conesize to a string
char coneNumber[4];
// -- Convert the conesize to a string (and don't forget the space for the terminating '\0'!)
char coneNumber[5];
sprintf(coneNumber, "%.2f", coneSizeCounter);
std::string conesize(coneNumber);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment