We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CppCon 2018: Chandler Carruth "Spectre: Secrets, Side-Channels, Sandboxes, and Security" https://youtu.be/_f7O3IfIR2k
The text was updated successfully, but these errors were encountered:
Here is one of the files used in the presentation "leaks.cpp" Rewritten from the video: https://youtu.be/_f7O3IfIR2k?t=420
#include <iostream> #include <string_view> constexpr std::string_view text_table[] = {"Hello World!", "Hello CppCon!", "It's a s3kr3t!!!"}; int main(int argc, char** argv) { int text_index = 0; if (argc > 1) text_index = std::stoi(argv[1]); std::cerr << "Text buffer index: " << text_index << "\n"; if (text_index > 1) { std::cerr << "ERROR: Only first two buffers are public!\n"; exit(1); } std::string_view text = text_table[text_index]; int length = text.size(); if (argc > 2) length = std::stoi(argv[2]); std::cerr << "Length: " << length << "\n"; std::cout << text.size() - length << "\n"; if (text.size() - length < 0) { std::cerr << "ERROR: Buffer is only" << text.size() << " characters!\n"; exit(1); } std::string_view to_print(text.begin(), length); std::cout << to_print << "\n"; }
Sorry, something went wrong.
No branches or pull requests
CppCon 2018: Chandler Carruth "Spectre: Secrets, Side-Channels, Sandboxes, and Security"
https://youtu.be/_f7O3IfIR2k
The text was updated successfully, but these errors were encountered: