Improve NormalizedNodeInputStreamReader defensiveness 88/80888/2
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 15 Mar 2019 11:20:24 +0000 (12:20 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 15 Mar 2019 11:28:57 +0000 (12:28 +0100)
commitbfed3c0a9e208b7fd45d6a853f9c63ef95fde00e
treeb1d16fc44886310ac4f005fd8d34deb702d03104
parent628e4c6fa9bd55ea49eda4cd8e0a5cfcfdfa7dc5
Improve NormalizedNodeInputStreamReader defensiveness

If face of corrupted streams, for example due to CONTROLLER-1752,
we can end up interpreting unknown bytes as null strings, potentially
corrupting data.

This patch uses explicit type dispatch and detects wrong string
value types, as well as rejecting unknown string value codes.

Change-Id: Ic2e7887bc1d32a1dc7a364d1bff195752edd762d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.