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

start compiling editor #826

Merged
merged 1 commit into from
Apr 24, 2016
Merged

start compiling editor #826

merged 1 commit into from
Apr 24, 2016

Conversation

MAnyKey
Copy link
Contributor

@MAnyKey MAnyKey commented Apr 24, 2016

for #655

  • fix printf-like function calls
  • move platform_interface.cpp to 'pc' folder
  • fix linking lua
  • fix stb int typedefs

* fix printf-like function calls
* move platform_interface.cpp to 'pc' folder
* fix linking lua
* fix stb int typedefs
@@ -302,7 +302,7 @@ bool AssetBrowser::resourceInput(const char* label, const char* str_id, char* bu
m_wanted_resource = buf;
}
ImGui::SameLine();
ImGui::Text(label);
ImGui::Text("%s", label);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the problem with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcc can check string format strings and arguments and gives warning (which becomes error with -Werror)

../../../src/editor/asset_browser.cpp: In member function ‘bool AssetBrowser::resourceInput(const char*, const char*, char*, int, Lumix::uint32)’:
../../../src/editor/asset_browser.cpp:305:19: error: format not a string literal and no format arguments [-Werror=format-security]
  ImGui::Text(label);
                   ^
cc1plus: all warnings being treated as errors

If you pass printf-like function not a string literal but some received string, this function can misinterpret it (suppose this string has %s in it) and read arbitrary memory.

@nem0 nem0 merged commit 9353d6c into nem0:master Apr 24, 2016
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

Successfully merging this pull request may close these issues.

2 participants