Added zer bytes compression protection

This commit is contained in:
Michiel Broek
2005-01-17 20:01:03 +00:00
parent c4abc58d12
commit c02c520c16
2 changed files with 7 additions and 1 deletions

View File

@@ -1963,7 +1963,7 @@ int binkp_poll_frame(void)
if ((bp.rxlen == (bp.blklen + 1) && (bp.rxlen >= 1))) {
bp.GotFrame = TRUE;
#ifdef HAVE_ZLIB_H
if ((bp.PLZflag == Active) && (bp.header & BINKP_PLZ_BLOCK)) {
if ((bp.PLZflag == Active) && (bp.header & BINKP_PLZ_BLOCK) && bp.blklen) {
zbuf = calloc(BINKP_ZIPBUFLEN, sizeof(char));
zlen = BINKP_PLZ_BLOCK -1;
rc = uncompress(zbuf, &zlen, bp.rxbuf, bp.rxlen -1);