{lzx,xpress}_decode_match(): Fix undefined pointer evalution
authorEric Biggers <ebiggers3@gmail.com>
Fri, 1 Nov 2013 05:19:32 +0000 (00:19 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 1 Nov 2013 05:42:06 +0000 (00:42 -0500)
commit926ff6c5ed956b96fcb521b2c20afcf9ac890b14
tree91377c35b6b10ea09983d95240fa0caae30e84e8
parent6b8d739e7c68237499366546eb41bc4cb3fff9d4
{lzx,xpress}_decode_match():  Fix undefined pointer evalution

According to C99 6.5.6.8, calculating a pointer that points before the
allocated object has undefined behavior.  However, this was done by
lzx_decode_match() and xpress_decode_match() if they received a match
pointing before the end of the window (invalid match offset).  This
commit fixes this check to be fully defined.

This change likely has no visible effect in actual builds, e.g. with gcc.
src/lzx-decompress.c
src/xpress-decompress.c