Silly error in buffer.c

Bug #650828 reported by agricola
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NakedMud
In Progress
High
agricola

Bug Description

This bug can manifest itself in a number of ways, essentially causing random crashes. It mainly happens when the OLC is used. Buffers of a particular length are not extended when they should be, causing much agony.

Line 126 of buffer.c should be changed from

if(to_replace * (b_len - a_len) + buf->len > buf->maxlen)

to

if(to_replace * (b_len - a_len) + buf->len >= buf->maxlen)

agricola (agricola)
Changed in nakedmud:
assignee: nobody → agricola (agricola)
status: New → In Progress
importance: Undecided → Critical
importance: Critical → High
Revision history for this message
agricola (agricola) wrote :

An alternate/ancillary/complementary fix offered by Stendec was to change line 113 from:

int len_needed = buf->maxlen;

to

int len_needed = buf->maxlen + 1;

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.