Here's the patch including the patch + unittests. .... wait I can't send attachment through groups??? sigh
I will send it to you via email. Frank On Oct 20, 2:39 pm, "Kenton Varda" <[EMAIL PROTECTED]> wrote: > Oh, and thanks for catching these! > > On Mon, Oct 20, 2008 at 2:38 PM, Kenton Varda <[EMAIL PROTECTED]> wrote: > > Would you care to add some tests to the unit test to check for these bugs? > > Otherwise, I'll do that when I apply these patches. > > > On Mon, Oct 20, 2008 at 2:13 PM, <[EMAIL PROTECTED]> wrote: > > >> Sorry, I did some reading, and this should the format I send patch in: > > >> Index: src/google/protobuf/io/zero_copy_stream_impl.cc > >> =================================================================== > >> --- src/google/protobuf/io/zero_copy_stream_impl.cc (revision 67) > >> +++ src/google/protobuf/io/zero_copy_stream_impl.cc (working copy) > >> @@ -218,7 +218,8 @@ > >> char junk[4096]; > >> int skipped = 0; > >> while (skipped < count) { > >> - int bytes = Read(junk, min(count, > >> implicit_cast<int>(sizeof(junk)))); > >> + int bytes = Read(junk, min(count - skipped, > >> + implicit_cast<int>(sizeof(junk)))); > >> if (bytes <= 0) { > >> // EOF or read error. > >> return skipped; > >> @@ -757,7 +758,7 @@ > >> } > > >> bool LimitingInputStream::Next(const void** data, int* size) { > >> - if (limit_ < 0) return false; > >> + if (limit_ <= 0) return false; > >> if (!input_->Next(data, size)) return false; > > >> limit_ -= *size; > > >> Thanks, > >> Frank > > >> On Oct 17, 6:33 am, [EMAIL PROTECTED] wrote: > >> > Whoops, sorry, I meant the other way around > >> > 761c761 > >> > < if (limit_ < 0) return false; > >> > --- > > >> > > if (limit_ <= 0) return false; > > >> > Frank > > >> > On Oct 17, 6:32 am, [EMAIL PROTECTED] wrote: > > >> > > Another patch: > >> > > 761c761 > >> > > < if (limit_ <= 0) return false; > >> > > --- > > >> > > > if (limit_ < 0) return false; > > >> > > Frank > > >> > > On Oct 17, 3:11 am, [EMAIL PROTECTED] wrote: > > >> > > > I found a bug in zero_copy_stream_impl.cc. Here's the patch > >> > > > 221c221,222 > >> > > > < int bytes = Read(junk, min(count, > >> > > > implicit_cast<int>(sizeof(junk)))); > >> > > > --- > > >> > > > > int bytes = Read(junk, min(count - skipped, > >> > > > > implicit_cast<int>(sizeof(junk)))); > > >> > > > Frank > > >> > > > PS. Please let me know if this is the right way of sending in > >> patches. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~----------~----~----~----~------~----~------~--~---