Alright, I can't figure this one out. The debugger isn't giving much information about this particular exception.
Here is the function being called:
NC_LIBEXPORT(VOID) ncKeyExpand(unsigned char* key, int initlen)
{
int abspos = initlen;
int curkpos = 0;
do
{
key[abspos] = key[curkpos];
++abspos;
++curkpos;
if(curkpos >= initlen)
curkpos = 0;
} while (curkpos < NC_KEY_MAX_LENGTH);
}
And the access violation happens on the second line here:
unsigned char apkey[NC_KEY_MAX_LENGTH];
ncKeyExpand(&apkey[0], NC_PRIV_KEY_LENGTH);
Any insight as to why this is happening? Nothing I do is fixing it.
Unhandled exception at 0x776e7094 in Test Application.exe: 0xC0000005:
That is the exact error.
Access violation.
Aren't access violations when a pointer points to an address that isn't accessible, like if it's been freed or out of scope, or null, etc.? If so, why is it being raised here? The char array is right there.