]> source.dussan.org Git - gitblit.git/commitdiff
Fix NPE in raw servlet for long project names 63/163/1
authorJames Moger <james.moger@gitblit.com>
Fri, 5 Sep 2014 16:07:37 +0000 (12:07 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 5 Sep 2014 16:07:37 +0000 (12:07 -0400)
src/main/java/com/gitblit/servlet/RawServlet.java

index 7504b4bec39cda7af2d0a54c93b4cc47283dbd32..9fb96a5dac93abab85eef54bb1f46156416ad43c 100644 (file)
@@ -172,10 +172,7 @@ public class RawServlet extends DaggerServlet {
                        } else {
                                repository = path.substring(0, slash);
                        }
-                       offset += slash;
-                       if (offset == 0) {
-                               offset++;
-                       }
+                       offset += ( slash + 1 );
                        r = repositoryManager.getRepository(repository, false);
                        if (repository.equals(path)) {
                                // either only repository in url or no repository found