Fix OOM condition in style checking: move buffer processing out of read loop
Code was obviously broken, just look at it ;) BUG:375037