Address printbuf review comments

This commit is contained in:
Darren Carreras committed 2026-08-09 20:01:12 -04:00
1 parent 62bb838c57
commit 9782370c3f
3 files changed
+26 -2

No files matched your search

+1 -2
View File
@@ -97,8 +97,6 @@ static int printbuf_extend(struct printbuf *p, int min_size)
int printbuf_memappend(struct printbuf *p, const char *buf, int size)
{
int buf_offset = -1;
/* Prevent signed integer overflows with large buffers. */
if (size < 0 || size > INT_MAX - p->bpos - 1)
{
@@ -107,6 +105,7 @@ int printbuf_memappend(struct printbuf *p, const char *buf, int size)
}
if (p->size <= p->bpos + size + 1)
{
int buf_offset = -1;
const uintptr_t buf_addr = (uintptr_t)(const void *)buf;
const uintptr_t p_buf_addr = (uintptr_t)(const void *)p->buf;