Parcourir la source

i2c: strncpy does not null terminate string

strlcpy() will always null terminate the string.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Roel Kluin il y a 16 ans
Parent
commit
783fd6fa4c
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      drivers/i2c/busses/i2c-omap.c

+ 1 - 1
drivers/i2c/busses/i2c-omap.c

@@ -879,7 +879,7 @@ omap_i2c_probe(struct platform_device *pdev)
 	i2c_set_adapdata(adap, dev);
 	adap->owner = THIS_MODULE;
 	adap->class = I2C_CLASS_HWMON;
-	strncpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
+	strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
 	adap->algo = &omap_i2c_algo;
 	adap->dev.parent = &pdev->dev;