]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
staging: rtl8723bs: check for i out of range before accessing szLine[i]
authorColin Ian King <colin.king@canonical.com>
Thu, 6 Sep 2018 12:32:07 +0000 (13:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Sep 2018 15:12:42 +0000 (17:12 +0200)
commitd5c69c96798f908679bccc453547a65870bcf709
tree40fb18cea4597d53c2982d4c371f80b256e84fe1
parentec3d17acd6a6778329fd6b7237d1bda3e0b94688
staging: rtl8723bs: check for i out of range before accessing szLine[i]

Currently szLine[i] is being accessed before the index i is being
ranged checked.  Fix this by checking the range first.  Also, evaluate
the length of the string szLine just once rather than multiple times and
move the loop variable i to an inner scope and make it an int.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c