Bug 2519

Summary: m_windowOffsetsMap.end () dereference in TraceFadingLossModel::DoCalcRxPowerSpectralDensity
Product: ns-3 Reporter: Alexander Krotov <krotov>
Component: lteAssignee: Biljana Bojović <bbojovic>
Status: RESOLVED FIXED    
Severity: major CC: ns-bugs, tomh, tommaso.pecorella
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Proposed patch
Proposed patch

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. ***