Commit 8f76943
authored
Use RuntimeHelpers.GetHashCode in IndexObject (#7678)
## Summary of changes
This changes to use a means to get the hash code of an object to handle
`null`, `object.GetHashCode` and a fallback to use RuntimeHelpers
`GetHashCode` for when `object.GetHashCode` fails.
## Reason for change
My guess is that `GetHashCode` is overridden for the given object and we
probably should avoid that?
Spotted the following in Error Tracking:
```
Error : PropagationModuleImpl.PropagateWholeResultWhenInputTainted exception
System.NullReferenceException
at REDACTED
at Datadog.Trace.Iast.DefaultTaintedMap.IndexObject(Object objectStored)
at Datadog.Trace.Iast.DefaultTaintedMap.Get(Object objectToFind)
at Datadog.Trace.Iast.Propagation.PropagationModuleImpl.PropagateWholeResultWhenInputTainted(String result, Object input1, Object input2, Object input3)
```
## Implementation details
Swapped from one to the other.
## Test coverage
🤷 Didn't try to reproduce
## Other details
<!-- Fixes #{issue} -->
<!-- 1 parent 8603e6d commit 8f76943
File tree
2 files changed
+15
-2
lines changed- tracer/src/Datadog.Trace/Iast
2 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
75 | 88 | | |
76 | 89 | | |
77 | 90 | | |
| |||
0 commit comments