Forward port r14502, r16217, and parts of r16222.
Forward port r14502, r16217, and parts of r16222.

Don't try to read past the end of the comment packet if the string lengths are
 corrupt.
Correct a potential comment length sanity check overflow.
Commit additional hardening to comment packet decode.

Also add allocation checks, since these can still run us out of address space
 if someone actually sends a GB or two of comment data.


git-svn-id: 02eba07bc0c2c0487331a52a9df1c6a735722a92@17514 0101bb08-14d6-0310-b084-bc0e0c8e3800

spritebuilder/tremor,mwgoldsmith/tremor,spritebuilder/tremor,mwgoldsmith/tremor,oss-forks/tremor,oss-forks/tremor,spritebuilder/tremor,oss-forks/tremor,mwgoldsmith/tremor