since ‎23-04-2019
‎25-10-2020
karthickv998656
Level 1
Re: How to read a file or stream in  Most Robust way using Java?
Avatar

karthickv998656

karthickv998656
- Adobe Experience Manager
Hi rampai,I have tried that too, but its throwing error.

Views

1.9K

Likes

0

Replies

0
How to read a file or stream in Most Robust way using Java?
Avatar

karthickv998656

karthickv998656
- Adobe Experience Manager
protected void doPost(SlingHttpServletRequest req, SlingHttpServletResponse resp) throws IOException {BufferedReader reader = req.getReader();try{String line = reader != null ? reader.readLine() : null;}finally{reader.close();}The above code went for a review with the Security team and the following comments were received:BufferedReader.readLine is susceptible to DOS (Denial of Service) attacks (line of infinite length, huge file containing no line feed/carriage return)Resource exhaustion for th...

Views

2.0K

Likes

0

Replies

2