8192978: Missing checks and small fixes in jdwp library
Reviewed-by: cjplummer, sspitsyn
This commit is contained in:
parent
18e476899c
commit
03193f6b9b
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2017, 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
|
||||
@ -839,7 +839,7 @@ writePaths(PacketOutputStream *out, char *string) {
|
||||
}
|
||||
|
||||
pos = string;
|
||||
for ( i = 0 ; i < npaths ; i++ ) {
|
||||
for ( i = 0 ; i < npaths && pos != NULL; i++ ) {
|
||||
char *psPos;
|
||||
int plen;
|
||||
|
||||
@ -859,8 +859,6 @@ writePaths(PacketOutputStream *out, char *string) {
|
||||
jvmtiDeallocate(buf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static jboolean
|
||||
classPaths(PacketInputStream *in, PacketOutputStream *out)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2017, 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
|
||||
@ -71,6 +71,7 @@ vprint_message(FILE *fp, const char *prefix, const char *suffix,
|
||||
|
||||
/* Fill buffer with single UTF-8 string */
|
||||
(void)vsnprintf((char*)utf8buf, sizeof(utf8buf), format, ap);
|
||||
utf8buf[sizeof(utf8buf) - 1] = 0;
|
||||
len = (int)strlen((char*)utf8buf);
|
||||
|
||||
/* Convert to platform encoding (ignore errors, dangerous area) */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2017, 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
|
||||
@ -47,7 +47,7 @@ const char * jdwpErrorText(jdwpError);
|
||||
#define THIS_FILE __FILE__
|
||||
#endif
|
||||
|
||||
#define EXIT_ERROR(error,msg) \
|
||||
#define EXIT_ERROR(error, msg) \
|
||||
{ \
|
||||
print_message(stderr, "JDWP exit error ", "\n", \
|
||||
"%s(%d): %s [%s:%d]", \
|
||||
@ -56,21 +56,21 @@ const char * jdwpErrorText(jdwpError);
|
||||
debugInit_exit((jvmtiError)error, msg); \
|
||||
}
|
||||
|
||||
#define JDI_ASSERT(expression) \
|
||||
do { \
|
||||
if (gdata && gdata->assertOn && !(expression)) { \
|
||||
#define JDI_ASSERT(expression) \
|
||||
do { \
|
||||
if (gdata && gdata->assertOn && !(expression)) { \
|
||||
jdiAssertionFailed(THIS_FILE, __LINE__, #expression); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define JDI_ASSERT_MSG(expression, msg) \
|
||||
do { \
|
||||
if (gdata && gdata->assertOn && !(expression)) { \
|
||||
#define JDI_ASSERT_MSG(expression, msg) \
|
||||
do { \
|
||||
if (gdata && gdata->assertOn && !(expression)) { \
|
||||
jdiAssertionFailed(THIS_FILE, __LINE__, msg); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define JDI_ASSERT_FAILED(msg) \
|
||||
#define JDI_ASSERT_FAILED(msg) \
|
||||
jdiAssertionFailed(THIS_FILE, __LINE__, msg)
|
||||
|
||||
void do_pause(void);
|
||||
|
@ -471,11 +471,8 @@ synthesizeUnloadEvent(void *signatureVoid, void *envVoid)
|
||||
jbyte eventSessionID = currentSessionID;
|
||||
struct bag *eventBag = eventHelper_createEventBag();
|
||||
|
||||
if (eventBag == NULL) {
|
||||
/* TO DO: Report, but don't die
|
||||
*/
|
||||
JDI_ASSERT(eventBag != NULL);
|
||||
}
|
||||
/* TO DO: Report null error, but don't die */
|
||||
JDI_ASSERT(eventBag != NULL);
|
||||
|
||||
/* Signature needs to last, so convert extra copy to
|
||||
* classname
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2017, 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
|
||||
@ -808,7 +808,6 @@ invoker_completeInvokeRequest(jthread thread)
|
||||
mustReleaseReturnValue = request->invokeType == INVOKE_CONSTRUCTOR ||
|
||||
returnTypeTag(request->methodSignature) == JDWP_TAG(OBJECT) ||
|
||||
returnTypeTag(request->methodSignature) == JDWP_TAG(ARRAY);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2017, 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
|
||||
@ -187,6 +187,7 @@ log_message_end(const char *format, ...)
|
||||
/* Construct message string. */
|
||||
va_start(ap, format);
|
||||
(void)vsnprintf(message, sizeof(message), format, ap);
|
||||
message[sizeof(message) - 1] = 0;
|
||||
va_end(ap);
|
||||
|
||||
get_time_stamp(datetime, sizeof(datetime));
|
||||
|
Loading…
Reference in New Issue
Block a user