OSDN Git Service
(root)
/
stock
/
stock.osdn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
296d39b
)
v2ezusb.py: check limits
author
Pawel Jewstafjew
<Pawel.Jewstafjew@gmail.com>
Sun, 8 Feb 2015 19:17:24 +0000
(19:17 +0000)
committer
Pawel Jewstafjew
<Pawel.Jewstafjew@gmail.com>
Sun, 8 Feb 2015 19:17:24 +0000
(19:17 +0000)
v2h/v2ezusb.py
patch
|
blob
|
history
diff --git
a/v2h/v2ezusb.py
b/v2h/v2ezusb.py
index
2203d3a
..
bcbac60
100755
(executable)
--- a/
v2h/v2ezusb.py
+++ b/
v2h/v2ezusb.py
@@
-69,6
+69,9
@@
for sec in sections:
addr = sec.start
length = sec.len()
print 'addr:', hex(addr), 'len:', length
+ # validate EZ-USB limits
+ assert(addr < 0x4000) # 14-bit address
+ assert(length < 1024) # 10-bit length
data += data_HL(length)
data += data_HL(addr)
for i in range(length):