Skip to content

Commit 4ee8b4b

Browse files
author
erki1993
committed
add byte_count check
1 parent 18572ba commit 4ee8b4b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

intelhex/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ def write_hex_file(self, f, write_start_addr=True, eolstyle='native', byte_count
557557
Supported eol styles: 'native', 'CRLF'.
558558
@param byte_count number of bytes in the data field
559559
"""
560+
if byte_count > 255 or byte_count < 1:
561+
raise ValueError("wrong byte_count " + str(byte_count))
560562
fwrite = getattr(f, "write", None)
561563
if fwrite:
562564
fobj = f

0 commit comments

Comments
 (0)