소스 검색

mmc: Use snprintf, not sprintf.

Fix an issue found by klockwork. Just paranoia.

Signed-off-by: JiebingLi <jiebing.li@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
JiebingLi 15 년 전
부모
커밋
12578f66b9
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      drivers/mmc/card/block.c

+ 2 - 1
drivers/mmc/card/block.c

@@ -620,7 +620,8 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
 	 * messages to tell when the card is present.
 	 * messages to tell when the card is present.
 	 */
 	 */
 
 
-	sprintf(md->disk->disk_name, "mmcblk%d", devidx);
+	snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
+		"mmcblk%d", devidx);
 
 
 	blk_queue_logical_block_size(md->queue.queue, 512);
 	blk_queue_logical_block_size(md->queue.queue, 512);