Revision: 9c79d568c1b4
Author: Strullu <[email protected]>
Date: Wed Jan 16 06:00:46 2013
Log: Correction issue 43: URL parsing error on URL without
user/password: infinite loop
http://code.google.com/p/jain-sip/source/detail?r=9c79d568c1b4&repo=javascript
Modified:
/src/main/javascript/gov/nist/sip/parser/URLParser.js
=======================================
--- /src/main/javascript/gov/nist/sip/parser/URLParser.js Thu Oct 25
05:47:12 2012
+++ /src/main/javascript/gov/nist/sip/parser/URLParser.js Wed Jan 16
06:00:46 2013
@@ -688,7 +688,7 @@
URLParser.prototype.password =function(){
if(logger!=undefined) logger.debug("URLParser:password()");
var startIdx = this.lexer.getPtr();
- while (true) {
+ while (this.lexer.hasMoreChars()) {
var la = this.lexer.lookAhead(0);
var isValidChar = false;
switch (la) {
@@ -706,7 +706,6 @@
} else {
break;
}
-
}
return this.lexer.getBuffer().substring(startIdx, this.lexer.getPtr());
}