rbd: use snprintf for disk->disk_name
authorSage Weil <sage@newdream.net>
Fri, 13 May 2011 03:57:03 +0000 (20:57 -0700)
committerSage Weil <sage@newdream.net>
Tue, 24 May 2011 18:52:03 +0000 (11:52 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
drivers/block/rbd.c

index 0d80967e140c19d21fe0bc0e40ee65a664bbecc9..d833d02b321f239b840266f739a6a878eb47cacf 100644 (file)
@@ -1721,7 +1721,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
        if (!disk)
                goto out;
 
-       sprintf(disk->disk_name, DRV_NAME "%d", rbd_dev->id);
+       snprintf(disk->disk_name, sizeof(disk->disk_name), DRV_NAME "%d",
+                rbd_dev->id);
        disk->major = rbd_dev->major;
        disk->first_minor = 0;
        disk->fops = &rbd_bd_ops;