-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 08/05/2015 15:02, Eric Blake wrote: >>>>> Do we also want to handle "case 0: return 0;" on either >>>>> conversion, or even "case 0: abort();" to ensure that >>>>> callers are using these helpers correctly? >>> >>> Yes, it's much better that way. > Thinking about it a bit more: abort() is fine on the sending side, > to ensure we aren't putting garbage on the wire; but abort() on > the receiving side is a bit risky (we should be handling a > corrupted incoming stream gracefully - a malicious sender should > not be able to crash us). Of course, once we've detected a > corrupted incoming stream, we can't do much for the block device > the stream was supposed to represent (perhaps treat it as EIO and > declare the device dead), but that's still better than aborting. I've included "case 0: return 0;" in the pull request. Paolo -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVTLRxAAoJEL/70l94x66DiU0IAIc9c7XNRGkOzvx8Dr/euTZh urx9OVG4Mwpust8KDmquuBJUv18Xu+omh9AxWOkF5ChZUGBwVxyt0N4sKPreVXK2 zJgObt+5cV4o1FXMb3QcFn1CD7s6+8V8T2QukGTviCsIwRaovwpBQAMuT4N5aJWY BTkCE8GiGTVYiWhV+Uz3UML33j5mXJ4WM2LP11ndsKZpFNMvezwo9iyvQe28EqrI Cj6xz+pLbnOtTu3/Kdf1SMA4FK9loH7/y6fth833TIBE/OIyY+PEtNKoq7TJzc3i /S58dVjXNZAez1Bf0Hb9rMCKsGg/MSv7mGPU5IsLQSKgZ0i154ZzJFxifkXnzYU= =fZNP -----END PGP SIGNATURE-----