]> Zhao Yanbai Git Server - minix.git/commitdiff
libbdev: resolve Coverity warnings
authorDavid van Moolenbroek <david@minix3.org>
Fri, 27 Jul 2012 14:55:10 +0000 (14:55 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Mon, 30 Jul 2012 12:10:12 +0000 (12:10 +0000)
lib/libbdev/driver.c

index efe2fa2a2640fd17a6333af14b9068c105df3795..6c0a3deaec19ab08c614439251921e3d8cdd84d2 100644 (file)
@@ -51,7 +51,7 @@ endpoint_t bdev_driver_set(dev_t dev, char *label)
   assert(major >= 0 && major < NR_DEVICES);
   assert(strlen(label) < sizeof(driver_tab[major].label));
 
-  strcpy(driver_tab[major].label, label);
+  strlcpy(driver_tab[major].label, label, sizeof(driver_tab[major].label));
 
   driver_tab[major].endpt = NONE;