changeset 4981:96bbb23bbaca

7167359: (tz) SEGV on solaris if TZ variable not set Reviewed-by: okutsu
author coffeys
date Fri, 11 May 2012 11:52:04 +0100
parents 997176fc0a83
children 8004f3dd5c54 c743f3d53835
files src/solaris/native/java/util/TimeZone_md.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/util/TimeZone_md.c	Thu May 10 17:53:21 2012 -0700
+++ b/src/solaris/native/java/util/TimeZone_md.c	Fri May 11 11:52:04 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -646,7 +646,7 @@
     }
 
 #ifdef __solaris__
-    if (strcmp(tz, "localtime") == 0) {
+    if (tz != NULL && strcmp(tz, "localtime") == 0) {
         tz = getSolarisDefaultZoneID();
         freetz = tz;
     }