--- old/src/hotspot/share/prims/jvm.cpp 2018-06-08 23:33:13.863790680 +0900 +++ new/src/hotspot/share/prims/jvm.cpp 2018-06-08 23:33:13.685790325 +0900 @@ -2678,10 +2678,10 @@ int jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args) { // Reject count values that are negative signed values converted to // unsigned; see bug 4399518, 4417214 - if ((intptr_t)count <= 0) return -1; + if ((intptr_t)count < 0) return -1; int result = os::vsnprintf(str, count, fmt, args); - if (result > 0 && (size_t)result >= count) { + if (count > 0 && result > 0 && (size_t)result >= count) { result = -1; }