Skip to content

Commit 143fa6f

Browse files
committed
SOLR-16949: Tolerate null bytes / empty file
1 parent 7e9a2e6 commit 143fa6f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

solr/core/src/java/org/apache/solr/util/FileTypeMagicUtil.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ public static boolean isFileForbiddenInConfigset(InputStream fileStream) {
142142
* @return true if file is among the forbidden mime-types
143143
*/
144144
public static boolean isFileForbiddenInConfigset(byte[] bytes) {
145+
if (bytes == null || bytes.length == 0)
146+
return false; // A ZK znode may be a folder with no content
145147
return isFileForbiddenInConfigset(new ByteArrayInputStream(bytes));
146148
}
147149

0 commit comments

Comments
 (0)