diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:23:42 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:23:42 +0000 |
commit | 82711f6567ef069eebb942e382e2c3fa61fbf538 (patch) | |
tree | 22200b7326b32ca672ffb6e4ce6d19a09dc476e5 /gcc48-pr65142.patch | |
parent | 5d624aa0d36abe76a344f0593eae5cf36d083b15 (diff) |
automatic import of compat-libgfortran-48openeuler24.03_LTSopeneuler23.09
Diffstat (limited to 'gcc48-pr65142.patch')
-rw-r--r-- | gcc48-pr65142.patch | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc48-pr65142.patch b/gcc48-pr65142.patch new file mode 100644 index 0000000..367ec16 --- /dev/null +++ b/gcc48-pr65142.patch @@ -0,0 +1,23 @@ +2016-06-01 Jakub Jelinek <jakub@redhat.com> + + Backported from mainline + 2015-10-02 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/65142 + * src/c++11/random.cc (random_device::_M_getval()): Check read result. + +--- libstdc++-v3/src/c++11/random.cc (revision 228423) ++++ libstdc++-v3/src/c++11/random.cc (revision 228424) +@@ -126,8 +126,10 @@ namespace std _GLIBCXX_VISIBILITY(defaul + #endif + + result_type __ret; +- std::fread(reinterpret_cast<void*>(&__ret), sizeof(result_type), +- 1, _M_file); ++ const size_t e = std::fread(reinterpret_cast<void*>(&__ret), ++ sizeof(result_type), 1, _M_file); ++ if (e != 1) ++ std::__throw_runtime_error(__N("random_device could not be read")); + return __ret; + } + |