[yecht] 04/13: Fix an IOOBE - JRUBY-4254
Miguel Landaeta
nomadium at moszumanska.debian.org
Sat Jan 24 21:47:01 UTC 2015
This is an automated email from the git hooks/post-receive script.
nomadium pushed a commit to branch master
in repository yecht.
commit 853d9041790c833bbf6c8c06d3272c759926e531
Author: Ola Bini <ola.bini at gmail.com>
Date: Sun Nov 22 11:56:30 2009 -0800
Fix an IOOBE - JRUBY-4254
---
ext/ruby/src/java/org/yecht/ruby/RubyErrHandler.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ext/ruby/src/java/org/yecht/ruby/RubyErrHandler.java b/ext/ruby/src/java/org/yecht/ruby/RubyErrHandler.java
index bb758aa..452f923 100644
--- a/ext/ruby/src/java/org/yecht/ruby/RubyErrHandler.java
+++ b/ext/ruby/src/java/org/yecht/ruby/RubyErrHandler.java
@@ -25,7 +25,11 @@ public class RubyErrHandler implements ErrorHandler {
if(lp < 0) {
lp = 0;
}
- String line = new String(p.buffer.buffer, lp, endl-lp, "ISO-8859-1");
+ int len = endl-lp;
+ if(len < 0) {
+ len = 0;
+ }
+ String line = new String(p.buffer.buffer, lp, len, "ISO-8859-1");
String m1 = msg + " on line " + p.linect + ", col " + (p.cursor-lp) + ": `" + line + "'";
throw runtime.newArgumentError(m1);
} catch(java.io.UnsupportedEncodingException e) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/yecht.git
More information about the pkg-java-commits
mailing list