mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 17:08:08 -04:00
xcf: set buffer to 0 if read less data that expected
Fixes MemorySanitizer: use-of-uninitialized-value on fuzzed file
This commit is contained in:
parent
3923c9b855
commit
d6ae11a691
@ -540,7 +540,11 @@ bool XCFImageFormat::loadProperty(QDataStream &xcf_io, PropType &type, QByteArra
|
||||
return false;
|
||||
}
|
||||
data = new char[size];
|
||||
xcf_io.readRawData(data, size);
|
||||
const quint32 dataRead = xcf_io.readRawData(data, size);
|
||||
if (dataRead < size) {
|
||||
// qDebug() << "XCF: loadProperty read less data than expected" << data_length << dataRead;
|
||||
memset(&data[dataRead], 0, size - dataRead);
|
||||
}
|
||||
}
|
||||
|
||||
if (size != 0 && data) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user