This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/81395] basic_filebuf::overflow recurses and overflows stack


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81395

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I'm testing this patch:

--- a/libstdc++-v3/include/bits/fstream.tcc                                     
+++ b/libstdc++-v3/include/bits/fstream.tcc                                     
@@ -699,7 +699,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION                            

           if (__n == 0)                                                        
             {                                                                  
-              _M_set_buffer(0);                                                
+              _M_set_buffer(-1);                                               
               _M_reading = true;                                               
             }                                                                  
           else if (__len == 0)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]