tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BugRat Mail System <tomcat-b...@cortexity.com>
Subject BugRat Report #152 has been filed.
Date Fri, 22 Sep 2000 01:13:18 GMT
Bug report #152 has just been filed.

You can view the report at the following URL:

   <http://znutar.cortexity.com:8888/BugRatViewer/ShowReport/152>

REPORT #152 Details.

Project: Tomcat
Category: Bug Report
SubCategory: New Bug Report
Class: swbug
State: received
Priority: high
Severity: critical
Confidence: public
Environment: 
   Release: 3.2b4
   JVM Release: 1.2.2
   Operating System: HP-UX
   OS Release: 11.04
   Platform: HP

Synopsis: 
Infinite loop in PrefixManager.java

Description:
While running some tests with TomCat, I uncovered an infinite loop in
PrefixManager.java.

The routine getLongestPrefixMatch has the following chunk of code:

	while (s.length() >= 0) {
	    //if(debug>8) context.log( "Prefix: " + s  );
	    container = myMap.prefixMappedServlets.get(s);

	    if (container == null) {
		s=URLUtil.removeLast( s );
	    }  else {
		if( myMap.mapCacheEnabled ) {
		    // XXX implement LRU or another replacement alghoritm
		    myMap.mapCache.put( path, container );
		}
		return container;
	    }
	}
	return container;
    }

The problem is that if myMap.prefixMappedServlet.get(s) never finds a
container, the code goes into an infinite loop:

I changed the while statement to:

	while (s.length() > 0) {

and at least it exited and threw an execption.

This situation occurred when I had a servlet mapped to a URL /myurl but then
used a custom application going through a proxy server that changed the url:
https://www.xxx.com/myurl  to http://www.xxx.com:443/myurl



Mime
View raw message