summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2018-07-01 19:32:04 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-10 08:52:05 +0200
commitef9211bb9a767b058679ba7fdeca00e93f1d457c (patch)
tree1125e3ec36030c3dd24b41dcd8a0838f64d57c16 /tools/perf/scripts/python
parent73b0eecd584437817d73e0d8ee716d375c221ac7 (diff)
usb: wusbcore: security: cast sizeof to int for comparison
[ Upstream commit d3ac5598c5010a8999978ebbcca3b1c6188ca36b ] Comparing an int to a size, which is unsigned, causes the int to become unsigned, giving the wrong result. usb_get_descriptor can return a negative error code. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ int x; expression e,e1; identifier f; @@ *x = f(...); ... when != x = e1 when != if (x < 0 || ...) { ... return ...; } *x < sizeof(e) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions