[PATCH] Storage: Fix a buffer overflow in write_link_key

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

 



The temporary string allocated on the stack is not large enough in worst
case. To be on the safe side, increase it to 64 bytes.

Signed-off-by: Ido Yariv <ido@xxxxxxxxxx>
---
 src/storage.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/storage.c b/src/storage.c
index a65cee4..7e7f081 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -533,7 +533,7 @@ int write_lastused_info(bdaddr_t *local, bdaddr_t *peer, struct tm *tm)
 
 int write_link_key(bdaddr_t *local, bdaddr_t *peer, unsigned char *key, uint8_t type, int length)
 {
-	char filename[PATH_MAX + 1], addr[18], str[38];
+	char filename[PATH_MAX + 1], addr[18], str[64];
 	int i;
 
 	memset(str, 0, sizeof(str));
-- 
1.7.7.6

--
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