Skip to content
Commit be076fdf authored by Dan Carpenter's avatar Dan Carpenter Committed by Richard Weinberger
Browse files

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: ae380ce0 ("UBIFS: lessen the size of debugging info data structure")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarAlexander Dahl <ada@thorsis.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent a2c2a622
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment