X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b1ab9ed8d0e0f1c3b66d7daa8fd5564444c56195..420ff9d9379a8d93f2c90f026a797bdea1eb4517:/libsecurity_comcryption/lib/comcryption.c?ds=sidebyside diff --git a/libsecurity_comcryption/lib/comcryption.c b/libsecurity_comcryption/lib/comcryption.c index 23ae85af..56d89b60 100644 --- a/libsecurity_comcryption/lib/comcryption.c +++ b/libsecurity_comcryption/lib/comcryption.c @@ -58,7 +58,7 @@ void comMallocRegister(comMallocExternFcn *mallocExtern, * Call once at startup. The resulting comcryptObj can be reused multiple * times. */ -comcryptObj comcryptAlloc() +comcryptObj comcryptAlloc(void) { comcryptPriv *cpriv = (comcryptPriv *) ascMalloc(sizeof(comcryptPriv)); @@ -750,7 +750,7 @@ static comcryptReturn comcryptBlock( * We already wrote tokens and longcode to cipherText; verify we * didn't overrun */ - totalCipherTextLen = (longCodePtr - startCtextPtr); + totalCipherTextLen = (unsigned)(longCodePtr - startCtextPtr); if(*cipherTextLen < totalCipherTextLen) { ddprintf(("comcryptBlock: short block (2)\n")); return CCR_OUTBUFFER_TOO_SMALL; @@ -1030,7 +1030,7 @@ static dcbReturn deComcryptBlock( numByteCodes = *byteCodePtr++; level2 = 1; } - *blockSize = (byteCodePtr - cipherText) + numByteCodes; + *blockSize = (unsigned)(byteCodePtr - cipherText) + numByteCodes; if(*blockSize > cipherTextLen) { return DCB_SHORT; } @@ -1439,6 +1439,6 @@ comcryptReturn deComcryptData( } } /* main loop */ - *plainTextLen = plainText - outorigin; + *plainTextLen = (unsigned)(plainText - outorigin); return CCR_SUCCESS; }