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

Various unsafe code in nlp_engine.cpp #486

Open
dhdaines opened this issue Jan 18, 2024 · 0 comments
Open

Various unsafe code in nlp_engine.cpp #486

dhdaines opened this issue Jan 18, 2024 · 0 comments

Comments

@dhdaines
Copy link

Widespread use of fixed-size buffers on the stack as strings is quite unsafe (too many examples to list but everywhere MAXPATH or MAXSTR is used).

Consider using _stprintf_s on Windows or snprintf on Unix, or using std::string (since it is being used elsewhere).

Also the ownership of _TCHAR * arguments pased to the API functions is unclear, it appears that they take ownership (and so these strings should not ever be deallocated by the caller).

Again consider using std::string since this is a C++ API. Otherwise mark them as const and copy the contents.

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