Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about : Heap corruption detected: after normal block..... #66

Open
ShaKing-L opened this issue Apr 13, 2024 · 3 comments
Open

Comments

@ShaKing-L
Copy link

ShaKing-L commented Apr 13, 2024

2024-04-13_225321
When using this library for decryption, an out of memory error may occur when the length of the string to be decrypted does not match. It is currently believed that when using the mid() function on QByteArray, it may be necessary to determine if the length limit has been exceeded. Like this:

for (int i = 0; i < rawText.size(); i += m_blocklen)
{
    if (i + m_blocklen > rawText.length()) 
    {
        break;
    }
    ret.append(invCipher(expandedKey, rawText.mid(i, m_blocklen)));
}
break;

I am not good at English, so I use translation tools. Please forgive me.Thank you!😄

@bricke
Copy link
Owner

bricke commented Apr 15, 2024

Can you write an example of HEAP Corruption?
Like what do you mean by "when the length of the string to be decrypted does not match" ?

@ShaKing-L
Copy link
Author

If the code
/K6O0t1d8dpWZpe8EbBwYgrAiN9o5V5RtUELRJI1IrFqgIzI03yijPlU/PFXlqnWJ7Km+GCNUZoUWO4VszwmgA==
can be successfully decode.

When I cut this code like this
/K6O0t1d8dpWZpe8EbBwYgrAiN9o5V5RtUELRJI1IrFqgIzI03yijPlU/PFXlqnWJ7Km+GCNUZoUW
this error will be reported.

@bricke
Copy link
Owner

bricke commented Apr 19, 2024

so that is your rawText ?

If so, it's odd as the decode function should return an empty QByteArray if the rawText compatible with the block length.
Please, make a sample code that I can easily run so I can see what are you actually triggering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants