Re: [PATCH 7/8] Possible static overrun removed

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

 



Hi Lucas,

Hi Pavel,

On Tue, Aug 16, 2011 at 6:51 AM, Pavel Raiskup <praiskup@xxxxxxxxxx> wrote:
There will be static overrun on c_brf_chip array when brf_chip
is greater than 7.
---
 tools/hciattach_tialt.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/hciattach_tialt.c b/tools/hciattach_tialt.c
index 1ba009c..fc3ed20 100644
--- a/tools/hciattach_tialt.c
+++ b/tools/hciattach_tialt.c
@@ -234,7 +234,8 @@ int texasalt_init(int fd, int speed, struct termios *ti)
                               ((brf_chip > 7) ? "unknown" :
c_brf_chip[brf_chip]),

Did you forget the line above? There's the same problem you fixed
below. Maybe it's better to set
brf_chip to 0 if it's greater than 7 here.

there is check for brf_chip > 7, I think this is correct. Anyway setting
brf_chip to 0 is not kosher cause IMO this variable is got from HW and when
plotting it out (on line 235) we want to have unchanged value. When HW gives
us weird value we want to know it.

                               brf_chip);

- sprintf(fw, "/etc/firmware/%s.bin", c_brf_chip[brf_chip]);
+               sprintf(fw, "/etc/firmware/%s.bin",
+ brf_chip > 7 ? "unknown" : c_brf_chip[brf_chip]);
               texas_load_firmware(fd, fw);

               texas_change_speed(fd, speed);
--

Pavel
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux