siox: fix possible buffer overflow in device_add_store
[linux-block.git] / drivers / siox / siox-core.c
index fdfcdea258678950d0c0cf502f7964a9087bf6cb..16590dfaafa448d43f00cbced0dbb457782fff93 100644 (file)
@@ -594,7 +594,7 @@ static ssize_t device_add_store(struct device *dev,
        size_t inbytes = 0, outbytes = 0;
        u8 statustype = 0;
 
-       ret = sscanf(buf, "%20s %zu %zu %hhu", type, &inbytes,
+       ret = sscanf(buf, "%19s %zu %zu %hhu", type, &inbytes,
                     &outbytes, &statustype);
        if (ret != 3 && ret != 4)
                return -EINVAL;