8177531: libGetNamedModuleTest.c crash when printing NULL-pointer
Summary: Fix the NULL-pointer issue
Reviewed-by: stuefe, simonis, sspitsyn
--- 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);