changeset 13363:015084c7ef97

8177531: libGetNamedModuleTest.c crash when printing NULL-pointer Summary: Fix the NULL-pointer issue Reviewed-by: stuefe, simonis, sspitsyn
author mbaesken
date Sat, 25 Mar 2017 00:00:13 -0700
parents bb104b4b64dc
children b0b56932255e
files test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c	Fri Mar 24 08:56:04 2017 -0700
+++ b/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);