mirror of
https://github.com/qpdf/qpdf.git
synced 2024-11-08 06:15:23 +00:00
Guard against 0 byte writes in Pl_Buffer and Pl_String
This commit is contained in:
parent
6aa6c01303
commit
0663f1f8db
@ -19,6 +19,9 @@ Pl_Buffer::~Pl_Buffer() // NOLINT (modernize-use-equals-default)
|
||||
void
|
||||
Pl_Buffer::write(unsigned char const* buf, size_t len)
|
||||
{
|
||||
if (!len) {
|
||||
return;
|
||||
}
|
||||
m->data.append(reinterpret_cast<char const*>(buf), len);
|
||||
m->ready = false;
|
||||
|
||||
|
@ -21,6 +21,9 @@ Pl_String::~Pl_String() // NOLINT (modernize-use-equals-default)
|
||||
void
|
||||
Pl_String::write(unsigned char const* buf, size_t len)
|
||||
{
|
||||
if (!len) {
|
||||
return;
|
||||
}
|
||||
m->s.append(reinterpret_cast<char const*>(buf), len);
|
||||
if (getNext(true)) {
|
||||
getNext()->write(buf, len);
|
||||
|
Loading…
Reference in New Issue
Block a user