-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Using uninitialized memory 'buf' in line 11173 v2.1.1? #613
Comments
No, this is fine. We checked the code with Valgrind and clang's sanitizers. Wenn you look at https://github.com/nlohmann/json/blob/v2.1.1/src/json.hpp#L11153 you see that
|
Visual Studio 2017 Code Analyser shows C6001 warning message at line 11173: Warning C6001 means: 'buf' isn't initialized at line 11173. So I wondered what the if statement will check in line 11173, because 'buf.size()' will most likely be always 0 at that point. Isn't it? |
|
Sorry for the false report. Feel free to delete this entry. |
No problem! Thanks for reporting! |
json.hpp v2.1.1
Using uninitialized memory 'buf'?
Lines
11149 std::array<char, 64> buf;
11173 if ((len + 1) < buf.size())
11174 {
11175 std::copy(m_start, m_end, buf.begin());
11176 buf[len] = 0;
11177 buf[ds_pos] = decimal_point_char;
11178 data = buf.data();
11179 }
The text was updated successfully, but these errors were encountered: