[YANGTOOLS-231] Make arrays non-mutable Created: 26/Jul/14 Updated: 10/Apr/22 Resolved: 10/Mar/17 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Dana Kutenicsova | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| Issue Links: |
|
||||||||
| Description |
|
All simple arrays are stored as they are, making it a security risk: Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations. |
| Comments |
| Comment by Ladislav Borak [ 13/Aug/14 ] |
|
proposed patch: https://git.opendaylight.org/gerrit/#/c/9686/ |