Commit 586b5857c4c47495caa12fbbe0511308b512875c
Committed by
GitHub
Merge pull request #316 from enkelli/fix-rtfobj-space-after-bin
Fix ignoring of optional whitespace after \bin.
Showing
1 changed file
with
1 additions
and
1 deletions
oletools/rtfobj.py
| @@ -578,7 +578,7 @@ class RtfParser(object): | @@ -578,7 +578,7 @@ class RtfParser(object): | ||
| 578 | # it should be treated as a null length: | 578 | # it should be treated as a null length: |
| 579 | binlen=0 | 579 | binlen=0 |
| 580 | # ignore optional space after \bin | 580 | # ignore optional space after \bin |
| 581 | - if self.data[self.index] == ' ': | 581 | + if ord(self.data[self.index:self.index + 1]) == ord(' '): |
| 582 | log.debug('\\bin: ignoring whitespace before data') | 582 | log.debug('\\bin: ignoring whitespace before data') |
| 583 | self.index += 1 | 583 | self.index += 1 |
| 584 | log.debug('\\bin: reading %d bytes of binary data' % binlen) | 584 | log.debug('\\bin: reading %d bytes of binary data' % binlen) |