diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-04-12 13:42:52 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-04-12 13:42:52 +0000 |
commit | e54810bed86a8131621a36fd257e7cc9f07337e1 (patch) | |
tree | 47d92f5c1c66673f0767cea366f3625e8d37f1cb | |
parent | 0da9052a215d9946b1e354ca530256ecfff9c800 (diff) |
check for inflateReset() and deflateReset() return values; OK niallo@.
-rw-r--r-- | usr.bin/cvs/compress.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/cvs/compress.c b/usr.bin/cvs/compress.c index a8f9ad35530..c31d6005092 100644 --- a/usr.bin/cvs/compress.c +++ b/usr.bin/cvs/compress.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compress.c,v 1.2 2006/04/05 01:38:55 ray Exp $ */ +/* $OpenBSD: compress.c,v 1.3 2006/04/12 13:42:51 xsa Exp $ */ /* * Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -104,7 +104,8 @@ cvs_zlib_inflate(CVSZCTX *ctx, BUF *dst, u_char *src, size_t slen) bytes = 0; cvs_buf_empty(dst); - inflateReset(&(ctx->z_instrm)); + if (inflateReset(&(ctx->z_instrm)) == Z_STREAM_ERROR) + fatal("inflate error: %s", ctx->z_instrm.msg); ctx->z_instrm.next_in = src; ctx->z_instrm.avail_in = slen; @@ -141,7 +142,8 @@ cvs_zlib_deflate(CVSZCTX *ctx, BUF *dst, u_char *src, size_t slen) bytes = 0; cvs_buf_empty(dst); - deflateReset(&(ctx->z_destrm)); + if (deflateReset(&(ctx->z_destrm)) == Z_STREAM_ERROR) + fatal("deflate error: %s", ctx->z_destrm.msg); ctx->z_destrm.next_in = src; ctx->z_destrm.avail_in = slen; |