Increase minimum allocation size from 256 to 1024 bytes.

This commit is contained in:
Todd C. Miller
2023-01-09 14:15:23 -07:00
parent 1f58e5a8e0
commit ca297658dd

View File

@@ -80,8 +80,8 @@ sudo_lbuf_expand(struct sudo_lbuf *lbuf, unsigned int extra)
unsigned int new_size = sudo_pow2_roundup(lbuf->len + extra + 1);
char *new_buf;
if (new_size < 256)
new_size = 256;
if (new_size < 1024)
new_size = 1024;
if ((new_buf = realloc(lbuf->buf, new_size)) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
"unable to allocate memory");