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
This commit is contained in:
Gregory Hainaut 2015-09-11 09:18:49 +02:00
parent 113c0aa411
commit 8928c3e7f1
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}