--- old/src/hotspot/share/prims/jvm.cpp 2018-05-01 09:30:57.523120776 +0900 +++ new/src/hotspot/share/prims/jvm.cpp 2018-05-01 09:30:57.359120165 +0900 @@ -2719,10 +2719,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; }