Skip to content

Commit

Permalink
throw ArgumentError instead of SecurityError
Browse files Browse the repository at this point in the history
  • Loading branch information
ahorek authored and headius committed Feb 16, 2020
1 parent 2ab63ec commit bcec463
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/util/StringSupport.java
Expand Up @@ -762,7 +762,7 @@ public static int octLength(byte[]bytes, int p, int len, Encoding enc) {

/**
* Check whether input object's string value contains a null byte, and if so
* throw SecurityError.
* throw ArgumentError.
* @param runtime
* @param value
*/
Expand All @@ -773,7 +773,7 @@ public static final void checkStringSafety(Ruby runtime, IRubyObject value) {
final int end = bl.length();
for (int i = bl.begin(); i < end; ++i) {
if (array[i] == (byte) 0) {
throw runtime.newSecurityError("string contains null byte");
throw runtime.newArgumentError("string contains null byte");
}
}
}
Expand Down

0 comments on commit bcec463

Please sign in to comment.