errlog: fix out-of-bounds read when resizing the print buffer
errlogBufResize copied the print buffer from &pvt.print->base (the address of the char* field inside the buffer_t struct) instead of pvt.print->base (the buffer it points to), reading bufSize bytes from an ~8-byte struct field. Drop the stray & so it reads the actual buffer, matching the adjacent log-buffer copy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
605542ece7
commit
ec0ae7d831
1 file changed
+1
-1
@@ -638,7 +638,7 @@ void errlogBufResize(struct initArgs config)
|
||||
memcpy(logbuf, pvt.log->base, pvt.bufSize);
|
||||
pvt.log->base = logbuf;
|
||||
|
||||
memcpy(printbuf, &pvt.print->base, pvt.bufSize);
|
||||
memcpy(printbuf, pvt.print->base, pvt.bufSize);
|
||||
pvt.print->base = printbuf;
|
||||
|
||||
pvt.bufSize = config.bufsize;
|
||||
|
||||
Reference in new issue
Block a user