Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: Bug: win32/say cmd & memory leak




 I've fixed the remainding problems with long items names/descriptions.  Even
though the server still worked after my last set of patches, there was still
memory corruption going on (this just noticed by examining the code) - there may
still be some problems out there, but it should be more stable now.

 I also have fixes in so that the long item names are handled properly by hte
server before being sent to the client.  These are all in CVS - here is a copy
of the changes:

include/define.h:  add safe_strcat inline/static function.  Add
    DESCRIBE_ABILITY_SAFE and DESCRIBE_PATH_SAFE which use the safe_strcat
    to prevent buffer overuns.
common/item.c:  Have query_name use HUGE_BUF for its buffer - query_short_name
    uses that buffer size, and we call the same thing.  have quer_name and
    query_short_name use the safe_strcat function.  Increase buffer size
    in ring_desc to be a VERY_BIG_BUF and also use safe_strcat along with the
    DESCRIBE_*_SAFE macros.
server/input.c:  Modify examine.c to not get buffer overruns for very long/
    complicated items.  Modify long_desc to also handle long names/descriptions
    without buffer overruns.
socket/item.c:  Modify the functions that prepend the length to the name
    of the object to handle very long (>255) object names properly - now we
    just truncate it and only send the first 255 bytes.  add function
    add_stringlen_to_sockbuf to make this task easier.
With the above changes, very long named items/items with very long
descriptions works properly in both the server (no crashes) and the
client (no crashes/protocol errors)  MSW 5/22/2000
-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to crossfire-request@ifi.uio.no]