pppd: Fix ccp_cilen calculated size if both deflate_correct and deflate_draft are...
authorSylvain Rochet <gradator@gradator.net>
Tue, 24 Mar 2015 20:21:40 +0000 (21:21 +0100)
committerPaul Mackerras <paulus@samba.org>
Fri, 14 Aug 2015 08:16:02 +0000 (18:16 +1000)
This fixes a bug where ccp_cilen() will return 4 bytes less than
necessary for the addci buffer if both deflate_correct and
deflate_draft are enabled.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
pppd/ccp.c

index 5814f358eb44c5a4791f06b8170c69d45e7c4e9d..7d7922afcfc0b2d4178319dc903dc3c19427c1c3 100644 (file)
@@ -676,7 +676,8 @@ ccp_cilen(f)
     ccp_options *go = &ccp_gotoptions[f->unit];
 
     return (go->bsd_compress? CILEN_BSD_COMPRESS: 0)
-       + (go->deflate? CILEN_DEFLATE: 0)
+       + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0)
+       + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0)
        + (go->predictor_1? CILEN_PREDICTOR_1: 0)
        + (go->predictor_2? CILEN_PREDICTOR_2: 0)
        + (go->mppe? CILEN_MPPE: 0);