[CF-Devel] Some bug fixes
crossfire-devel at archives.real-time.com
crossfire-devel at archives.real-time.com
Sun Mar 7 23:01:26 CST 2004
Andreas Kirschbaum wrote:
>
Mark Wedel wrote:
>
>>
Andreas Kirschbaum wrote:
>>
>>>
The patch patch-3.diff fixes two out of range errors in lines 737+
>>>
and 1061+. The remaining changes replace the sizeof-expressions with
>>>
the macro "arraysize".
>>
>>
If not seen any problems here, so I'm not positive what that change is
>>
fixing.
>
>
>
This change is fixing accesses to max_titles[] for incorrect indices
>
(i.e. book types). My server crashed because the bookarch file did
>
contain the types 20, 30, 40, 50, and 100 besides the (correct) types
>
0-5.
>
>
While loading the file, the function init_book_archive() in
>
common/readable.c does not check the values for "type", so the variable
>
"booklist" gets 101 entries.
>
>
The loop in line 737+ then traverses this list and prints the
>
corresponding values from max_titles[]. This does not work because
>
max_titles has 6 entries only.
>
>
The other fix in line 1061+ triggers when a book with an incorrect type
>
value is created, i.e. change_book() is called with with an incorrect
>
msgtype value.
Ok. That all makes sense now. Certainly most functions should check to see
if passed in values are valid - I wasn't aware that there were other cases where
the field type was used. So it is OK to commit the fix.
_______________________________________________
crossfire-devel mailing list
crossfire-devel at lists.real-time.com
https://mailman.real-time.com/mailman/listinfo/crossfire-devel
More information about the crossfire
mailing list