Skip to content

bug in String to be read is split into two or more records #2

@changhongcao

Description

@changhongcao

In Workbook::SharedStringTable::Read(const char* data) Bug

...
if (c >= maxContinue || npos+stringSizemultiplier+3 <= continueIndices_[c]) {
// String to be read is not split into two records
npos += strings_[i].Read(&
(data_.begin())+npos);
} else {
//strings_[i]'s richtext_,phonetic_ Members have not been initialized directly call continueread.
strings_[i].Read1(&*(data_.begin())+npos);

			// String to be read is split into two or more records
			int bytesRead = 2;// Start from unicode field

			int size = continueIndices_[c] - npos - 1 - bytesRead;

...

//read1 code
void LargeString::Read1(const char* data)
{
//short stringSize;
//LittleEndian::Read(data, stringSize, 0, 2);
LittleEndian::Read(data, unicode_, 2, 1);
ULONG npos = 3;

if (unicode_ & 8) {
	LittleEndian::Read(data, richtext_, npos, 2);
	npos += 2;
}

if (unicode_ & 4)
	LittleEndian::Read(data, phonetic_, npos, 4);

name_.clear();
wname_.clear();

}

  I am sorry my English is very poor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions