Phpword: Uninitialized string offset in MsDoc.php

Created on 6 Aug 2016  路  3Comments  路  Source: PHPOffice/PHPWord

When trying to parse a larger doc file I get the following stacktrace:

Uninitialized string offset: 2228225
C:\workspace\PhpOfficeUtils\vendor\phpoffice\phpword\src\PhpWord\Reader\MsDoc.php:2305
C:\workspace\PhpOfficeUtils\vendor\phpoffice\phpword\src\PhpWord\Reader\MsDoc.php:1147
C:\workspace\PhpOfficeUtils\vendor\phpoffice\phpword\src\PhpWord\Reader\MsDoc.php:1099
C:\workspace\PhpOfficeUtils\vendor\phpoffice\phpword\src\PhpWord\Reader\MsDoc.php:118
C:\workspace\PhpOfficeUtils\vendor\phpoffice\phpword\src\PhpWord\IOFactory.php:78

I tried to understand what's going on. As it seems the calculated aSed (MsDoc.php:1137) is not correct. The length of the given data string is only 1818112, why reading at index 2228225 causes this error.

Unfortunatelly my document includes sensible data why I cannot share it. If you need any further information please let me know.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Most helpful comment

I am having a similar issue, and I am not sure what's wrong. The file is created by Word for Mac.

All 3 comments

I am having a similar issue, and I am not sure what's wrong. The file is created by Word for Mac.

I am having the same issue with any *.doc file generated on a mac.

The same issue here, any solution?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahmednawazbutt picture ahmednawazbutt  路  3Comments

cedrictailly picture cedrictailly  路  5Comments

carlosvr90 picture carlosvr90  路  4Comments

D0Gmatist picture D0Gmatist  路  4Comments

Ryuzakix3 picture Ryuzakix3  路  6Comments