--- old/src/jdk.hotspot.agent/share/native/libsaproc/sadis.c 2018-03-08 22:12:34.014723839 +0900 +++ new/src/jdk.hotspot.agent/share/native/libsaproc/sadis.c 2018-03-08 22:12:33.110758763 +0900 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,6 +64,20 @@ #include #ifdef _WINDOWS +#define JVM_MAXPATHLEN _MAX_PATH +#else +#include + +#if defined(AIX) || defined(SOLARIS) +#define JVM_MAXPATHLEN MAXPATHLEN +#else +#define JVM_MAXPATHLEN MAXPATHLEN + 1 +#endif + +#endif + + +#ifdef _WINDOWS static int getLastErrorString(char *buf, size_t len) { long errval; @@ -112,7 +126,7 @@ const char *error_message = NULL; const char *jrepath = NULL; const char *libname = NULL; - char buffer[128]; + char buffer[JVM_MAXPATHLEN]; #ifdef _WINDOWS HINSTANCE hsdis_handle = (HINSTANCE) NULL;