security: StreamSource throws upon istream::fail()

refs #3741

Change-Id: I3742655ecfd93d47198c83b61664f8cea345d33e
diff --git a/src/security/transform/stream-source.cpp b/src/security/transform/stream-source.cpp
index 5248646..539506e 100644
--- a/src/security/transform/stream-source.cpp
+++ b/src/security/transform/stream-source.cpp
@@ -53,7 +53,7 @@
       dataOffset += nBytesWritten;
       dataLen -= nBytesWritten;
     }
-    else if (m_is.bad()) {
+    else if (!m_is) {
       BOOST_THROW_EXCEPTION(Error(getIndex(), "Input stream in bad state"));
     }
     else if (m_is.good()) {