Skip to content

Commit

Permalink
Fixed Uninitialized string offset for Excel5
Browse files Browse the repository at this point in the history
  • Loading branch information
Janson committed Mar 8, 2018
1 parent 4626c9d commit d5646c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Parser/Excel5.php
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,10 @@ private function readSst() {

// loop through the Unicode strings (16-bit length)
for ($i = 0; $i < $nm; ++$i) {
if (!isset($recordData[$pos+2])) {
break;
}

// number of characters in the Unicode string
$numChars = Format::getUInt2d($recordData, $pos);
$pos += 2;
Expand Down Expand Up @@ -1042,7 +1046,7 @@ private function readSst() {
$pos = $limitPos;

// keep reading the characters
while ($charsLeft > 0 && isset($recordData[$pos])) {
while ($charsLeft > 0) {
// look up next limit position, in case the string span more than one continue record
foreach ($spliceOffsets as $spliceOffset) {
if ($pos < $spliceOffset) {
Expand Down

0 comments on commit d5646c3

Please sign in to comment.