- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have been using std::stoi without problems for a long time but after upgrading to the latest compiler it crashes because of a buffer overflow in std::stoi("") when compiling with /GS (Buffer Security Check).
#include <string>
int main()
{
try {
std::stoi("");
} catch (...) {
return 1;
}
}
Compiling with Version 2021.7.1:
$> "C:\Program Files (x86)/Intel/oneAPI/compiler/2022.2.1/windows/bin/intel64/icl.exe" a.cpp /GS /EHsc
...
$> a.exe
$> echo %ErrorLevel%
-1073740791 # Apparently means stack buffer overflow
Compiling with version 2021.6.0:
$> "C:\Program Files (x86)/Intel/oneAPI/compiler/2022.1.0/windows/bin/intel64/icl.exe" a.cpp /GS /EHsc
...
$> a.exe
$> echo %ErrorLevel%
1 # As expected
I have also tested with oneApi, MSVC, GCC and Clang which all works as expected.
I realize that this compiler is deprecated and will probably not get too much attention at the moment...
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue seems to have been solved in "C++ Compiler Classic 2021.8" (oneAPI 2023.0)!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue seems to have been solved in "C++ Compiler Classic 2021.8" (oneAPI 2023.0)!
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page