]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Add some assertions in sshzlib.c.
authorSimon Tatham <anakin@pobox.com>
Sat, 22 Feb 2014 18:02:14 +0000 (18:02 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 22 Feb 2014 18:02:14 +0000 (18:02 +0000)
commite2a5c6b6799ddfa9ca03b6f7fd13d0012e7b2977
tree54f99ddfb04aa2142cb0fcd5e42c9087cf41d06c
parent3e71e3f9c0379cc41f5b2bf0d8d1cee01a2ea046
Add some assertions in sshzlib.c.

gcc 4.8 compiling with -O3 gives a new warning about the access to
st->pending at the top of lz77_compress, because for some reason it
thinks there's an out-of-bounds array access there (or perhaps just a
potential one, I'm not really sure which side -Warray-bounds is erring
on). Add an assertion reassuring it that st->npending can't get bigger
than the size of st->pending at the site it's complaining about, and a
second one at the site where st->npending is increased (just in case
my analysis of why it can't happen was wrong!). Also add a comment
explaining the assertions.

[originally from svn r10144]
sshzlib.c