Re: Help with liblist commands

From: Patrick Dughi (dughi@imaxx.net)
Date: 07/10/00


> I think what you will want to do is increase the buffer AND limit the
> amount of vnums returned. Since you're paging to the character, it won't
> disconnect them, but you do have the problem with the buffer.
>
> Or, alternately, find/invent another way to page it to the character.
>
> --SR


        Well, that's just a poor-man's fix.  It still has the potential to
break.  Just keep track of the character count.  Use strlen, or what have
you.... if ever 'strlen(buf) + strlen(next_line) > MAX_STRING_LENGTH' -
stop writing.  That way you'll never go over bounds.


> > On Mon, 10 Jul 2000, Patrick Dughi wrote:
>
> > > I have experienced slight problems with the liblist commands (mlist, olist,
> > > rlist, zlist) when I list with mlist, olist, and rlist and specify a range
> > > larger than <olist 1000 4100> (stock bpl17 zones plus 5 zones) the list
> > > worked fine with about 241 entries in the list, but greater than that, it
> > > doesn't work, what can I do to fix this?  It seems that the server crashes
> > > when the list goes over 300 entries, because when I used rlist, and the list
> > > ended at 309 it crashed after it was done printing with page_string...
> > >
> >
> >         This sounds like you haven't put in any sort of bounds checking.
> > Without looking at that patch, I would guess that it uses the global 'buf'
> > to write to, and that you're exceeding the MAX_STRING_LENGTH (or whatever
> > size 'buf' is in your system).  You can count chars and make sure you
> > don't overwrite the bounds, and truncate at the max length.(most users
> > can't take that level of screen spam anyway - their client will disconnect
> > them).
> >
> >         Of course, if you're lazy, you can just limit the number of
> > returns, or increase the size of your buffer.  These are just bandaids
> > though, and eventually it will crash again in the right circumstances.
> >
> >                                         PjD
> >
> >
> >      +------------------------------------------------------------+
> >      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
> >      |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
> >      +------------------------------------------------------------+
> >
>
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
>      +------------------------------------------------------------+
>


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT