Bug 2519 - m_windowOffsetsMap.end () dereference in TraceFadingLossModel::DoCalcRxPowerSpectralDensity
m_windowOffsetsMap.end () dereference in TraceFadingLossModel::DoCalcRxPowerS...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: lte
ns-3-dev
All All
: P5 major
Assigned To: Biljana Bojović
:
: 2140 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-12 08:44 UTC by Alexander Krotov
Modified: 2016-11-07 08:54 UTC (History)
3 users (show)

See Also:


Attachments
Proposed patch (1.26 KB, patch)
2016-10-12 08:44 UTC, Alexander Krotov
Details | Diff
Proposed patch (1.27 KB, patch)
2016-10-12 08:48 UTC, Alexander Krotov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Krotov 2016-10-12 08:44:05 UTC
Created attachment 2609 [details]
Proposed patch

If m_windowOffsetsMap.find (mobilityPair) returns m_windowOffsetsMap.end (),
it is stored into itOff.  Later itOff is dereferenced to calculate
index. To avoid dereferencing m_windowOffsetsMap.end (), itOff should
be updated with a reference to newely inserted element.
Comment 1 Alexander Krotov 2016-10-12 08:48:56 UTC
Created attachment 2610 [details]
Proposed patch

forgot ".first"
Comment 2 Biljana Bojović 2016-10-18 10:48:40 UTC
Hi Alexander,

thank you very much for reporting the bug and providing the patch for it. 

I have checked it and yes, ifOff needs to be initialized in both branches "if" and "else", since it is used later in the code. 

I am fine with the patch. Can you please commit/push it to ns-3-dev? 

Biljana
Comment 3 Alexander Krotov 2016-10-19 01:35:14 UTC
Pushed in changeset 6ce2f4e01995
Comment 4 Biljana Bojović 2016-10-19 04:07:43 UTC
(In reply to Alexander Krotov from comment #3)
> Pushed in changeset 6ce2f4e01995

Thanks!
Comment 5 Biljana Bojović 2016-11-07 08:54:35 UTC
*** Bug 2140 has been marked as a duplicate of this bug. ***