]> www.vanbest.org Git - sasc-ng.git/commitdiff
seca: fix memcpy in ECM/EMM processing, broken by AUTOMEM change
authorleslie <unknown>
Wed, 2 Jan 2008 00:01:04 +0000 (01:01 +0100)
committerleslie <unknown>
Wed, 2 Jan 2008 00:01:04 +0000 (01:01 +0100)
systems/seca/seca.c

index 920bb9edf946df0b0460a4beda5aea92b9a5b6d0..086a0f32016646242999909308715dbcfd80561a 100644 (file)
@@ -1227,7 +1227,7 @@ bool cSystemSeca::ProcessECM(const cEcmInfo *ecmD, unsigned char *data)
   cKeySnoop ks(this,'S',ecmD->provId,keyNr&0x0F);
   unsigned char *buff=AUTOMEM(msgLen);
   while((pk=keys.FindKey('S',ecmD->provId,keyNr&0x0F,key8?8:16,pk))) {
-    memcpy(buff,ecm,sizeof(buff)); // if decoding fails we need the original data
+    memcpy(buff,ecm,msgLen); // if decoding fails we need the original data
     
     unsigned char PK[16], signature[20];
     pk->Get(PK);
@@ -1565,7 +1565,7 @@ void cSystemSeca::ProcessEMM(int pid, int caid, unsigned char *buffer)
         }
 
       unsigned char signature[20];
-      memcpy(buff,emm,sizeof(buff)); // if decoding fails we need the original de-sse'd data
+      memcpy(buff,emm,msgLen); // if decoding fails we need the original de-sse'd data
 
       if(!SE) {
         for(int i=0 ; i<=64 && i<msgLen-8; i+=8) Decrypt(&buff[i],MK,T1,T2);