Home
last modified time | relevance | path

Searched hist:be076fdf8369f3b4842362c64cd681f3d498f3dd (Results 1 – 2 of 2) sorted by relevance

/openbmc/linux/drivers/mtd/ubi/
H A Ddebug.cdiff be076fdf8369f3b4842362c64cd681f3d498f3dd Tue May 11 02:12:00 CDT 2021 Dan Carpenter <dan.carpenter@oracle.com> ubifs: fix snprintf() checking

The snprintf() function returns the number of characters (not
counting the NUL terminator) that it would have printed if we
had space.

This buffer has UBIFS_DFS_DIR_LEN characters plus one extra for
the terminator. Printing UBIFS_DFS_DIR_LEN is okay but anything
higher will result in truncation. Thus the comparison needs to be
change from == to >.

These strings are compile time constants so this patch doesn't
affect runtime.

Fixes: ae380ce04731 ("UBIFS: lessen the size of debugging info data structure")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
/openbmc/linux/fs/ubifs/
H A Ddebug.cdiff be076fdf8369f3b4842362c64cd681f3d498f3dd Tue May 11 02:12:00 CDT 2021 Dan Carpenter <dan.carpenter@oracle.com> ubifs: fix snprintf() checking

The snprintf() function returns the number of characters (not
counting the NUL terminator) that it would have printed if we
had space.

This buffer has UBIFS_DFS_DIR_LEN characters plus one extra for
the terminator. Printing UBIFS_DFS_DIR_LEN is okay but anything
higher will result in truncation. Thus the comparison needs to be
change from == to >.

These strings are compile time constants so this patch doesn't
affect runtime.

Fixes: ae380ce04731 ("UBIFS: lessen the size of debugging info data structure")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Richard Weinberger <richard@nod.at>