[patch 1/2] staging: ks7010: parsing bugs in ks_wlan_read_config_file()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The check for the NUL terminator is wrong so it looks like this could
read beyond the end of the buffer.

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/drivers/staging/ks7010/ks7010_config.c b/drivers/staging/ks7010/ks7010_config.c
index 4b495cb..fb90012 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -358,7 +358,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 					break;
 				wk_p++;
 				for (j = 0; *wk_p != '"'; j++) {
-					if (wk_p == '\0') {
+					if (*wk_p == '\0') {
 						break;
 					}
 					priv->reg.ssid.body[j] = *wk_p++;
@@ -443,7 +443,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 					break;
 				wk_p++;
 				for (j = 0; *wk_p != '"'; j++) {
-					if (wk_p == '\0') {
+					if (*wk_p == '\0') {
 						break;
 					}
 					priv->reg.rom_file[j] = *wk_p++;
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux