diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@looxix.net> | 2005-06-27 01:42:51 +0200 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-26 17:21:18 -0700 |
| commit | e2559ab1f5d44c4708c60ff8cae240a854b56d34 (patch) | |
| tree | d24d7145b4113fadbd6204f51f0ff6baec28a38c /validation | |
| parent | 0feb9170ed4aad6a2c54f2850eb3d845cde77845 (diff) | |
| download | sparse-dev-e2559ab1f5d44c4708c60ff8cae240a854b56d34.tar.gz | |
[PATCH] avoid segafult after parse errors in casts
Avoid deferencing a null pointer after parse errors in casts.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@looxix.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/bad-cast.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/validation/bad-cast.c b/validation/bad-cast.c new file mode 100644 index 00000000..bafd5a25 --- /dev/null +++ b/validation/bad-cast.c @@ -0,0 +1,6 @@ +struct st; + +static int foo(int a) +{ + return (struct/st *) a; +} |
