8177531: libGetNamedModuleTest.c crash when printing NULL-pointer
authormbaesken
Sat, 25 Mar 2017 00:00:13 -0700
changeset 44330 aaa5ce0d9d01
parent 44329 4e76a9a3b7a8
child 44331 61e01c0389ba
8177531: libGetNamedModuleTest.c crash when printing NULL-pointer Summary: Fix the NULL-pointer issue Reviewed-by: stuefe, simonis, sspitsyn
hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c
--- a/hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c	Fri Mar 24 08:56:04 2017 -0700
+++ b/hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c	Sat Mar 25 00:00:13 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -183,7 +183,7 @@
     err = (*jvmti)->GetNamedModule(jvmti, loader, pkg_name, module_ptr);
     if (err != JVMTI_ERROR_NONE) {
         printf("    Error in GetNamedModule for package \"%s\": %s (%d)\n",
-               pkg_name, TranslateError(err), err);
+               name, TranslateError(err), err);
         return err;
     }
     printf("    returned module: %p\n", *module_ptr);