projects
/
sx
/
simavr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
regExp
home
|
summary
|
tags
|
heads
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
raw
|
patch
| inline |
side by side
(parent:
0f6f5c4
)
Commit
e86d9e52075e2edd37fe497b0d11a2df3fd1df31
author
Michel Pollet
<buserror@gmail.com>
Thu, 9 Apr 2015 20:27:56 +0000
(21:27 +0100)
committer
Michel Pollet
<buserror@gmail.com>
Thu, 9 Apr 2015 20:27:56 +0000
(21:27 +0100)
that ioctl requires a parameter, but doesn't check it. Static analyzer
doesn't like that at all.
Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/avr_ioport.c
patch
|
blob
|
history
|
download
diff --git
a/simavr/sim/avr_ioport.c
b/simavr/sim/avr_ioport.c
index 19c994835c2b284e71d30ba6538cb61205b11dab..14fabce2437056867ecf623b3ac7b279395829c9 100644
(file)
--- a/
simavr/sim/avr_ioport.c
+++ b/
simavr/sim/avr_ioport.c
@@
-168,6
+168,10
@@
avr_ioport_ioctl(
avr_ioport_t * p = (avr_ioport_t *)port;
avr_t * avr = p->io.avr;
int res = -1;
+
+ // all IOCTls require some sort of valid parameter, bail if not
+ if (!io_param)
+ return -1;
switch(ctl) {
case AVR_IOCTL_IOPORT_GETIRQ_REGBIT: {