Skip to content

Commit

Permalink
Merge pull request #35452 from CeliaFernandez/fix_UBSAN_issue35036_MU…
Browse files Browse the repository at this point in the history
…O-TSGFromL2Muon

Fix undefined behavior in TSGFromL2 from empty pointer
  • Loading branch information
cmsbuild committed Oct 7, 2021
2 parents ccb5275 + 157c420 commit 15f50df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.cc
Expand Up @@ -90,6 +90,8 @@ void TSGFromL2Muon::produce(edm::Event& ev, const edm::EventSetup& es) {
std::unique_ptr<RectangularEtaPhiTrackingRegion> region;
if (theRegionBuilder) {
region = theRegionBuilder->region(muRef);
} else {
region = std::make_unique<RectangularEtaPhiTrackingRegion>();
}

//Make seeds container
Expand Down
Expand Up @@ -43,6 +43,8 @@ class RectangularEtaPhiTrackingRegion final : public TrackingRegion {

static UseMeasurementTracker stringToUseMeasurementTracker(const std::string& name);

RectangularEtaPhiTrackingRegion() {}

RectangularEtaPhiTrackingRegion(RectangularEtaPhiTrackingRegion const& rh)
: TrackingRegion(rh),
theEtaRange(rh.theEtaRange),
Expand Down
2 changes: 2 additions & 0 deletions RecoTracker/TkTrackingRegions/interface/TrackingRegion.h
Expand Up @@ -46,6 +46,8 @@ class TrackingRegion {
typedef SeedingLayerSetsHits::Hits Hits;

public:
TrackingRegion() {}

TrackingRegion(const GlobalVector& direction,
const GlobalPoint& originPos,
const Range& invPtRange,
Expand Down

0 comments on commit 15f50df

Please sign in to comment.