arrays are useful for maintaining the mapping, while algorithms such as breadth-first search help to traverse the graph, although both of these require extra storage. Various serialization libraries provide general swizzling systems. In many cases, however, swizzling can be performed with simplifying assumptions, such as a tree or list structure of references. The different types of swizzling are: Automatic swizzling On-demand swizzling Potential security weaknesses For security, unswizzling and swizzling must be implemented with great caution. In particular, an attacker's presentation of a specially crafted file may allow access to addresses outside of the expected and proper bounds. In systems with weak memory protection this can lead to exposure of confidential data or modification of code likely to be executed. If the system does not implement guards against execution of data the system may be severely compromised by the installation of various kinds of malware. Methods of protection include verifications prior to releasing the data to an application: That every offset lies within the bounds of the data read. That a table of indexes and the records pointed to is similarly constrained. That identifiers are unique and, if sensitive, encrypted. That all variable-length data is restrained to lengths not exceeding the actual allocation. That allocations are of reasonable size. That allocations made that are not loaded with data read are cleared, or loaded with some specific pattern. See also Relocation, an eager form of pointer modification References Further reading (49 pages) Memory management