From 8928c3e7f13c0ebeba4ad32e0908049e88319e0a Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 11 Sep 2015 09:18:49 +0200 Subject: [PATCH] onepad: be sure pad variable is 0 or 1 CID 146918 (#1 of 1): Use of untrusted scalar value (TAINTED_SCALAR) tainted_data: Passing tainted variable pad to a tainted sink --- plugins/onepad/Linux/ini.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/onepad/Linux/ini.cpp b/plugins/onepad/Linux/ini.cpp index 85f8afaa60..0a0933edd9 100644 --- a/plugins/onepad/Linux/ini.cpp +++ b/plugins/onepad/Linux/ini.cpp @@ -199,7 +199,7 @@ void LoadConfig() u32 keysym; u32 index; while( fscanf(f, "PAD %d:KEYSYM 0x%x = %d\n", &pad, &keysym, &index) != EOF ) { - set_keyboad_key(pad, keysym, index); + set_keyboad_key(pad & 1, keysym, index); if(pad == 0) have_user_setting = true; }