linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Storage: Fix a buffer overflow in write_link_key
@ 2012-03-05 18:12 Ido Yariv
  2012-03-05 20:01 ` Johan Hedberg
  0 siblings, 1 reply; 3+ messages in thread
From: Ido Yariv @ 2012-03-05 18:12 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ido Yariv

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@wizery.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-06  1:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 18:12 [PATCH] Storage: Fix a buffer overflow in write_link_key Ido Yariv
2012-03-05 20:01 ` Johan Hedberg
2012-03-06  1:34   ` Ido Yariv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).