AndersDJohnson / AndersDJohnson/htmlcompressor

preserve-line-breaks causes StackOverFlow when consumed 2000 empty lines.

Đang mở
#101 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
auto-migrated Priority-Medium Type-Defect
Ngôn ngữ chính
Java
Star
1
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

```
What steps will reproduce the problem?
1. yes "" | head -n2000 > manylines
2. java -jar Downloads\htmlcompressor-1.5.3.jar --preserve-line-breaks manylines
3. crashes by StackOverFlow exception

What is the expected output? What do you see instead?
expected output is compressed html
instead I see fatal error.

What version of the product are you using? On what operating system?
htmlcompressor 1.5.3

java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

Windows 8.1 64bit

Please provide any additional information below.
I attached full stack trace by adding -XX:MaxJavaStackTraceDepth=1000000 option.

I think the last quantifier of lineBreakPattern in HtmlCompressor.java should
use '++' instead of '+'.
```

Original issue reported on code.google.com by `Hideki.Y...@gmail.com` on 31 Jan 2015 at 12:11

Attachments:
- [full_stack_trace.txt](https://storage.googleapis.com/google-code-attachments/htmlcompressor/issue-101/comment-0/full_stack_trace.txt)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.