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

can't detect utf-16 and utf-32 #8

Closed
Joungkyun opened this issue May 4, 2016 · 1 comment
Closed

can't detect utf-16 and utf-32 #8

Joungkyun opened this issue May 4, 2016 · 1 comment
Assignees
Milestone

Comments

@Joungkyun
Copy link
Owner

can't detect utf-16 and utf-32

@Joungkyun Joungkyun self-assigned this May 4, 2016
@Joungkyun Joungkyun added this to the 1.0.5 milestone May 4, 2016
@Joungkyun
Copy link
Owner Author

Joungkyun commented May 5, 2016

The cause of this bug is because detect and detect_handledata APIs are not binary safe.

These APIs used strlen() internally. If given strings are UTF-16 or UTF-32 that has BOM code, binary safe problem occurs.

To fix this problems, change prototype of these APIs as follows:

CHARDET_API short detect_handledata (Detect *, const char *, size_t, DetectObj *)

However, for comaptibility with old version, add new detect_handledata_r and detect_r APIs

So, don't use detect and detect_handledata APIs and replace to detect_r or detect_handledata_r.

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

No branches or pull requests

1 participant