diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..eb5a316
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+target
diff --git a/pom.xml b/pom.xml
index 7a01d24..e0611d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
fi.solita.clamav
clamav-client
- 1.0.1
+ 1.0.2
jar
Simple ClamAV client
Simple Java client for using clamd INSTREAM scanning in your application.
diff --git a/src/main/java/fi/solita/clamav/ClamAVClient.java b/src/main/java/fi/solita/clamav/ClamAVClient.java
index 7f14e11..13c9b71 100644
--- a/src/main/java/fi/solita/clamav/ClamAVClient.java
+++ b/src/main/java/fi/solita/clamav/ClamAVClient.java
@@ -156,7 +156,9 @@ private static byte[] readAll(InputStream is) throws IOException {
int read = 0;
do {
read = is.read(buf);
- tmp.write(buf, 0, read);
+ if (read > 0) {
+ tmp.write(buf, 0, read);
+ }
} while ((read > 0) && (is.available() > 0));
return tmp.toByteArray();
}