Rob Shearman : cabinet: Check buffer size before copying in NONEfdi_decomp.

Alexandre Julliard julliard at winehq.org
Wed Oct 1 14:09:40 CDT 2008


Module: wine
Branch: master
Commit: 79ad9cbcdd91559c04a6d519c4d9e718bab970a0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=79ad9cbcdd91559c04a6d519c4d9e718bab970a0

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Wed Oct  1 11:19:31 2008 +0100

cabinet: Check buffer size before copying in NONEfdi_decomp.

Check that the data will fit into the fixed sized buffer CAB(outbuf)
and return an error if not before copying.

---

 dlls/cabinet/fdi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c
index 4c499dd..35ad540 100644
--- a/dlls/cabinet/fdi.c
+++ b/dlls/cabinet/fdi.c
@@ -911,6 +911,7 @@ static int LZXfdi_init(int window, fdi_decomp_state *decomp_state) {
 static int NONEfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state)
 {
   if (inlen != outlen) return DECR_ILLEGALDATA;
+  if (outlen > CAB_BLOCKMAX) return DECR_DATAFORMAT;
   memcpy(CAB(outbuf), CAB(inbuf), (size_t) inlen);
   return DECR_OK;
 }




More information about the wine-cvs mailing list