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

Fixed strncpy in parse_imagepath #3552

Merged
merged 1 commit into from May 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions extensions/parse_imagepath/ace_parse_imagepath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,17 @@ std::string getImagePathFromStructuredText(const std::string & input) {
return returnValue;
}

// i like to live dangerously. jk, fix strncpy sometime pls.
#pragma warning( push )
#pragma warning( disable : 4996 )

void __stdcall RVExtension(char *output, int outputSize, const char *function) {
ZERO_OUTPUT();
if (!strcmp(function, "version")) {
strncpy(output, ACE_FULL_VERSION_STR, outputSize);
} else {
strncpy(output, getImagePathFromStructuredText(function).c_str(), outputSize);
output[outputSize - 1] = '\0';
}
if (!strcmp(function, "version")) {
strncpy_s(output, outputSize, ACE_FULL_VERSION_STR, _TRUNCATE);
} else {
strncpy_s(output, outputSize, getImagePathFromStructuredText(function).c_str(), _TRUNCATE);
output[outputSize - 1] = '\0';
}
EXTENSION_RETURN();
}

Expand Down