Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: utility/pack_firmware_image

Issue 6459017: Change pack_firmware_image::EntryBlob behavior (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utility/pack_firmware_image
diff --git a/utility/pack_firmware_image b/utility/pack_firmware_image
index d6251cd4db1815da8bf281470cd0929779957ea5..7ec8607328c09154a700eb70bfa24f266007eadb 100755
--- a/utility/pack_firmware_image
+++ b/utility/pack_firmware_image
@@ -129,9 +129,9 @@ class EntryBlob(EntryFmapArea):
def Pack(self, firmware_image, entries):
size = os.stat(self.path).st_size
- if size > 0:
- size = min(size, self.length)
- else:
+ if size > self.length:
+ raise PackError('blob too large: %d > %d' % (size, self.length))
+ if size == 0: # special case for files like /dev/zero
size = self.length
with open(self.path, 'rb') as blob_image:
firmware_image.seek(self.offset)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698