This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: RFA/RFC: vCont for the remote protocol [client]


On Thu, Oct 16, 2003 at 06:27:07PM -0400, Andrew Cagney wrote:
> >There are two probems:
> >>
> >>- the buffer can get very very large and that can blow the stack
> >>- it isn't possible to audit this code (with out a deep understanding of 
> >>that value) and hence demonstrate that the sprintf won't smash the 
> >>stack/heap
> >>
> >>You'll need to also change the sprintf to snprintf (parameterized with 
> >>remote_packet_size.
> >
> >
> >I don't see a point in doing that until someone expresses interest in
> >thread locking or some other feature which requires adding to the code. 
> >The maximum length of any generated vcont packet is the length of:
> >   vCont;C01:12341468;C02
> >The minimum possible buffer size is about twenty times that.
> 
> I wrote "it isn't possible to audit this code (with out a deep 
> understanding of that [remote_packet_size] value)".  The code should be 
> locally robust.

I wouldn't call the minimum size a deep understanding.  It isn't
documented anywhere in the code but I think that it should be.

But I'll fix it next week.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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