binman: Call ProcessUpdateContents() consistently
authorSimon Glass <sjg@chromium.org>
Mon, 8 Jul 2019 20:25:34 +0000 (14:25 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 24 Jul 2019 19:54:08 +0000 (12:54 -0700)
SetContents() should only be called to set the contents of an entry from
within the ObtainContents() call, since it has no guard against increasing
the size of the contents, thus triggering incorrect operation.

Change all such calls to use ProcessUpdateContents() instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/etype/blob_dtb.py
tools/binman/etype/fdtmap.py
tools/binman/etype/fmap.py
tools/binman/etype/image_header.py

index cc5b4a3f7609de18462d2dfc3c8f3737a9c9d5fb..d80c3d7e006ba1deed39c704311f2d9412a121f9 100644 (file)
@@ -30,4 +30,4 @@ class Entry_blob_dtb(Entry_blob):
     def ProcessContents(self):
         """Re-read the DTB contents so that we get any calculated properties"""
         _, data = state.GetFdtContents(self._filename)
-        self.SetContents(data)
+        self.ProcessContentsUpdate(data)
index cdeb491ebdc0bc936ad449391161d50ce7844e47..ddac148b9ba2726f2b72449c6e6877a186829fa6 100644 (file)
@@ -106,4 +106,4 @@ class Entry_fdtmap(Entry):
         This is necessary since new data may have been written back to it during
         processing, e.g. the image-pos properties.
         """
-        self.SetContents(self._GetFdtmap())
+        self.ProcessContentsUpdate(self._GetFdtmap())
index e6b5c5c74c060b4951c3f22aea7b5c0aeab60f99..45d6db18a318a2e86d06d5d2cb034c6370b64e86 100644 (file)
@@ -62,4 +62,4 @@ class Entry_fmap(Entry):
         return True
 
     def ProcessContents(self):
-        self.SetContents(self._GetFmap())
+        self.ProcessContentsUpdate(self._GetFmap())
index 9bc84ec01d46d9de9916a45ddb33614382c5918b..d6de58ce4b7be6bce8d60086e75ad2ca1c4327f8 100644 (file)
@@ -73,4 +73,4 @@ class Entry_image_header(Entry):
         This is necessary since image_pos is not available when ObtainContents()
         is called, since by then the entries have not been packed in the image.
         """
-        self.SetContents(self._GetHeader())
+        self.ProcessContentsUpdate(self._GetHeader())