This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: [PATCH/RFC] Fix interactive half of libstdc++/6745


Gabriel Dos Reis wrote:

Paolo Carlini <pcarlini@rocketmail.com> writes:

| ...
| else {
|   _CharT __buf[256];
|   streamsize __charsread = __sbin->sgetn(__buf,
| sizeof(__buf));

If this bit was already there in source, then I beleive it is
incorrect as sizeof(__buf) is 256 * sizeof (_CharT) which is not
necessarily 256 and we would get a buffer overrun :-(.

Yes, you are right, of course. I noticed that while preparing my tentative fix for the
interactive situations. In case my approach is not considered appropriate and the
correct one will involve different areas of the library, we shall properly size the buffer.

Anyway, in my patch the problem is not present ;-) ...

Thanks for your feedback, ciao, Paolo.




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