]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
wpan-phy: use snprintf to limit the amount of chars written
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Mon, 28 Sep 2009 14:58:32 +0000 (18:58 +0400)
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Fri, 6 Nov 2009 11:13:45 +0000 (14:13 +0300)
Use snprintf to limit the amount of chars put in the buffer for attr -> show.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
net/ieee802154/wpan-class.c

index a10ae5be6adb56badd698996478b44809314ccfd..68ccde63155b7a1a1d055b177cce2c5a1edd4414 100644 (file)
@@ -30,7 +30,7 @@ static ssize_t name ## _show(struct device *dev,                      \
        int ret;                                                        \
                                                                        \
        mutex_lock(&phy->pib_lock);                                     \
-       ret = sprintf(buf, format_string "\n", args);                   \
+       ret = snprintf(buf, PAGE_SIZE, format_string "\n", args);       \
        mutex_unlock(&phy->pib_lock);                                   \
        return ret;                                                     \
 }