Commit 85d90b1
committed
binder: fix out-of-bounds read in getServingNode()
servingNode_ is a std::vector, so indexing it past the end is undefined
behavior -- it does not "extend the vector with zeroes" as the comment
claimed. registerServingNode()/unregisterServingNode() both guard the
size already; getServingNode() did not.
Return NODEID_NONE for a UE that has no slot yet, which is what the
zero the old code happened to read would have meant anyway.
computeD2DCapability() indexed the vector directly with the same
problem; route it through getServingNode() instead.
Latent in the shipped configurations, since Registration registers
every UE at INITSTAGE_SIMU5G_NODE_RELATIONSHIPS, before any lookup.1 parent abace2a commit 85d90b1
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
| 244 | + | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| |||
631 | 632 | | |
632 | 633 | | |
633 | 634 | | |
634 | | - | |
| 635 | + | |
635 | 636 | | |
636 | 637 | | |
637 | 638 | | |
| |||
0 commit comments