Fix potential buffer overflow by using snprintf instead of sprintf

This commit is contained in:
Johan Hedberg 2009-10-23 21:25:28 +03:00
parent cfea4ccc6f
commit ece9ea1c2e

View File

@ -192,7 +192,7 @@ static int do_listen(void)
}
ba2str(&sa.rc_bdaddr, ba);
sprintf(ch, "%d", channel);
snprintf(ch, sizeof(ch), "%d", channel);
/* Setup environment */
setenv("DUN_BDADDR", ba, 1);