Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7959381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:33:50+00:00 2026-06-04T04:33:50+00:00

Alright, I can’t figure this one out. The debugger isn’t giving much information about

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:33:51+00:00Added an answer on June 4, 2026 at 4:33 am

    Your array is declared with length NC_KEY_MAX_LENGTH which means you can access locations of it from apkey[0] thr’ apkey[NC_KEY_MAX_LENGTH-1].

    if you look at your function

    do
    {
        key[abspos] = key[curkpos];
        ++abspos;
    

    you are accessing beyond your array size..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright I've been working on this for hours now and can't figure out my
Alright, I've spent about 5 hours trying to figure this out. Absolutely none of
Alright, I'm trying to figure out why I can't understand how to do this
Alright, I've been at this for days and can't seem to figure out what
Alright, I've been getting a NPE that I can't figure out and it's driving
Alright, relevant information can be found in this thread(Is that what they're called here?).
Alright, I can't seem to figure out what is going on, so I have
Alright there's two ways this can go. One is from the presentation side, and
Alright I've been debugging the whole day but can't figure out what the problem
Alright, it has been a long couple of days trying to figure this out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.