https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236935
--- Comment #5 from Phil Shafer <[email protected]> --- The fix is: +++ b/libxo/xo_buf.h @@ -114,7 +114,12 @@ static inline int xo_buf_has_room (xo_buffer_t *xbp, ssize_t len) { if (xbp->xb_curp + len >= xbp->xb_bufp + xbp->xb_size) { - ssize_t sz = xbp->xb_size + XO_BUFSIZ; + /* + * Find out how much new space we need, round it up to XO_BUFSIZ + */ + ssize_t sz = (xbp->xb_curp + len) - xbp->xb_bufp; + sz = (sz + XO_BUFSIZ - 1) & ~(XO_BUFSIZ - 1); + Instead of rounding up to XO_BUFSIZ, I was just adding XO_BUFSIZ. For large strings, this obviously fails. Thanks, Phil -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "[email protected]"
