From 583b760f6cd0449ea4944852e46350d9139bcacc Mon Sep 17 00:00:00 2001 From: leslie Date: Tue, 9 Dec 2008 18:38:15 +0100 Subject: [PATCH] cardclient-camd: check for partial valid CW --- systems/cardclient/camd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/systems/cardclient/camd.c b/systems/cardclient/camd.c index 5334a6d..a85f650 100644 --- a/systems/cardclient/camd.c +++ b/systems/cardclient/camd.c @@ -698,7 +698,8 @@ bool cCardClientCamd35::ProcessECM(const cEcmInfo *ecm, const unsigned char *dat while((n=RecvBlock(cb,sizeof(buff),0))>0) { if(cb->udp_header.cmd==0x01) { if(cb->udp_header.len>=16 && cb->service.pinID==pid && !res) { - memcpy(cw,cb->data,16); + if(!CheckNull(&cb->data[0],8)) memcpy(&cw[0],&cb->data[0],8); + if(!CheckNull(&cb->data[8],8)) memcpy(&cw[8],&cb->data[8],8); res=true; } else PRINTF(L_CC_CAMD35,"unexpected/bad CW packet"); -- 2.39.5