What hook can alter fully rendered html?
I highly recommend you not to alter the page output when you clearly know where the bug is. See Bala's answer. Or may be you want to let us know what is the exact problem ?

To answer your question, to alter the content that is going to be rendered, use hook_page_alter