8214061: Buffer written into itself
authorsgehwolf
Tue, 04 Dec 2018 17:54:13 +0100
changeset 52820 8527b6100a59
parent 52819 022420a4cc63
child 52821 a7e587822a2d
8214061: Buffer written into itself Summary: Actually write the msg text into the buffer. Reviewed-by: dcubed, sgehwolf, sspitsyn Contributed-by: Simon Tooke <stooke@redhat.com>
src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c
--- a/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c	Tue Dec 04 17:14:11 2018 +0100
+++ b/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c	Tue Dec 04 17:54:13 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -647,7 +647,7 @@
         (void)snprintf(buf, sizeof(buf), "JDWP %s, jvmtiError=%s(%d)",
                     msg, jvmtiErrorText(error), error);
     } else {
-        (void)snprintf(buf, sizeof(buf), "JDWP %s", buf);
+        (void)snprintf(buf, sizeof(buf), "JDWP %s", msg);
     }
     if (env != NULL) {
         (*((*env)->FatalError))(env, buf);