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

Incorrect decoding #2

Open
ac169 opened this issue Jan 9, 2025 · 0 comments
Open

Incorrect decoding #2

ac169 opened this issue Jan 9, 2025 · 0 comments

Comments

@ac169
Copy link

ac169 commented Jan 9, 2025

  1. The following data will fail to decode and return empty, Lines ”0x31, 0x3a, 0x79, 0x31, 0x3a, 0x72, 0x31, 0x3a, 0x76, 0x34, 0x3a, 0x4c, 0x54, 0x01, 0x02“ can be decoded correctly when the first 6 characters are deleted or changed to the end of the line
 unsigned char msg[] = {
            0x64, 0x32, 0x3a, 0x69, 0x70, 0x36, 0x3a, 0x01, 0x17, 0x03, 0x6e, 0x71, 0xcb, 0x31, 0x3a, 0x72,
            0x64, 0x32, 0x3a, 0x69, 0x64, 0x32, 0x30, 0x3a, 0x1c, 0x11, 0xe0, 0x1b, 0xe8, 0xe7, 0x8d, 0x76,
            0x5a, 0x2e, 0x63, 0x33, 0x9f, 0xc9, 0x9a, 0x66, 0x32, 0x0d, 0xb7, 0x54, 0x65, 0x31, 0x3a, 0x74,
            0x38, 0x3a, 0x70, 0x6e, 0x5f, 0x42, 0x49, 0x36, 0x44, 0x53,
            0x31, 0x3a, 0x79, 0x31, 0x3a, 0x72, 0x31, 0x3a, 0x76, 0x34, 0x3a, 0x4c, 0x54, 0x01, 0x02,
            0x65, 0x00
    };

 struct bencode *b = (struct bencode *) ben_decode(msg, strlen(msg));
  1. isprint() function does not work properly under windows.
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

1 participant