8194676: NullPointerException is thrown if ipaddress is not set

Reviewed-by: chegar, rriggs
This commit is contained in:
Vyom Tewari 2018-01-25 16:22:52 +05:30
parent 7e5577a6c1
commit 78de84bc1e
2 changed files with 97 additions and 2 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
@ -595,7 +595,7 @@ class Inet6Address extends InetAddress {
}
ObjectInputStream.GetField gf = s.readFields();
byte[] ipaddress = (byte[])gf.get("ipaddress", null);
byte[] ipaddress = (byte[])gf.get("ipaddress", new byte[0]);
int scope_id = gf.get("scope_id", -1);
boolean scope_id_set = gf.get("scope_id_set", false);
boolean scope_ifname_set = gf.get("scope_ifname_set", false);