diff options
author | Calin Juravle <calin@google.com> | 2014-04-24 10:46:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-24 10:46:04 +0000 |
commit | a6735a1f3cbe90f6f6555b4ebf10573a760bdb32 (patch) | |
tree | c8941ba46ee8848861203185204f2b4eebf0f533 | |
parent | 9064b9e19187fc52329c4342051f925c9d3a674a (diff) | |
parent | 232c91dce1760b180155256d1896d0d80375ff6d (diff) | |
download | libcore-a6735a1f3cbe90f6f6555b4ebf10573a760bdb32.zip libcore-a6735a1f3cbe90f6f6555b4ebf10573a760bdb32.tar.gz libcore-a6735a1f3cbe90f6f6555b4ebf10573a760bdb32.tar.bz2 |
Merge "Disallow explicit signs in SocketHandler port parsing."
-rw-r--r-- | luni/src/main/java/java/util/logging/SocketHandler.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/luni/src/main/java/java/util/logging/SocketHandler.java b/luni/src/main/java/java/util/logging/SocketHandler.java index 85a9e6c..48bfc0e 100644 --- a/luni/src/main/java/java/util/logging/SocketHandler.java +++ b/luni/src/main/java/java/util/logging/SocketHandler.java @@ -108,12 +108,9 @@ public class SocketHandler extends StreamHandler { // check the validity of the port number int p = 0; try { - p = Integer.parseInt(port); + p = Integer.parsePositiveInt(port); } catch (NumberFormatException e) { - throw new IllegalArgumentException("Illegal port argument"); - } - if (p <= 0) { - throw new IllegalArgumentException("Illegal port argument"); + throw new IllegalArgumentException("Illegal port argument " + port); } // establish the network connection try { |