changed decrypter's 'encryptedTextKeyChain' allocation to heap
This commit is contained in:
parent
5482dcac2f
commit
635f946671
@ -46,6 +46,7 @@ outputFlags decryptText(char *text, char *keyNew)
|
|||||||
int textKeyChainLength;
|
int textKeyChainLength;
|
||||||
int *textKeyChain;
|
int *textKeyChain;
|
||||||
char *key = malloc(strlen(keyNew) + 1);
|
char *key = malloc(strlen(keyNew) + 1);
|
||||||
|
int *encryptedTextKeyChain;
|
||||||
|
|
||||||
//COPY keyNew TO key
|
//COPY keyNew TO key
|
||||||
strcpy(key, keyNew);
|
strcpy(key, keyNew);
|
||||||
@ -59,7 +60,7 @@ outputFlags decryptText(char *text, char *keyNew)
|
|||||||
//SET LENGTH (numberBuffer)
|
//SET LENGTH (numberBuffer)
|
||||||
returningText = malloc(numberBuffer + 1);
|
returningText = malloc(numberBuffer + 1);
|
||||||
textKeyChain = malloc(sizeof(int) * numberBuffer);
|
textKeyChain = malloc(sizeof(int) * numberBuffer);
|
||||||
int encryptedTextKeyChain[sizeof(int) * numberBuffer];
|
encryptedTextKeyChain = malloc(sizeof(int) * numberBuffer);
|
||||||
textKeyChainLength = numberBuffer;
|
textKeyChainLength = numberBuffer;
|
||||||
|
|
||||||
//LOAD textKeyChain
|
//LOAD textKeyChain
|
||||||
@ -128,6 +129,7 @@ outputFlags decryptText(char *text, char *keyNew)
|
|||||||
|
|
||||||
//DEALLOCATION
|
//DEALLOCATION
|
||||||
free(textKeyChain);
|
free(textKeyChain);
|
||||||
|
free(encryptedTextKeyChain);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user