Commit a51513585117fedab6bc8c37a58a674ec26ae0a5

Authored by Vincent Brillault
1 parent 2c8866de

FormSiteData: jump to the end of the object in any case

Showing 1 changed file with 6 additions and 5 deletions
oletools/oleform.py
@@ -277,11 +277,12 @@ def consume_FormControl(stream): @@ -277,11 +277,12 @@ def consume_FormControl(stream):
277 consume_SiteClassInfo(stream) 277 consume_SiteClassInfo(stream)
278 (CountOfSites, CountOfBytes) = stream.unpacks('<LL', 8) 278 (CountOfSites, CountOfBytes) = stream.unpacks('<LL', 8)
279 remaining_SiteDepthsAndTypes = CountOfSites 279 remaining_SiteDepthsAndTypes = CountOfSites
280 - with stream.will_pad():  
281 - while remaining_SiteDepthsAndTypes > 0:  
282 - remaining_SiteDepthsAndTypes -= consume_FormObjectDepthTypeCount(stream)  
283 - for i in range(CountOfSites):  
284 - yield consume_OleSiteConcreteControl(stream) 280 + with stream.will_jump_to(CountOfBytes):
  281 + with stream.will_pad():
  282 + while remaining_SiteDepthsAndTypes > 0:
  283 + remaining_SiteDepthsAndTypes -= consume_FormObjectDepthTypeCount(stream)
  284 + for i in range(CountOfSites):
  285 + yield consume_OleSiteConcreteControl(stream)
285 286
286 def consume_MorphDataControl(stream): 287 def consume_MorphDataControl(stream):
287 # MorphDataControl: [MS-OFORMS] 2.2.5.1 288 # MorphDataControl: [MS-OFORMS] 2.2.5.1