======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x50)[0xb7774df0]
/lib/i386-linux-gnu/libc.so.6(+0xe4cca)[0xb7773cca]
/lib/i386-linux-gnu/libc.so.6(__strcpy_chk+0x3f)[0xb777305f]
./mkfs.btrfs[0x805acc4]
./mkfs.btrfs[0x805def6]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0xb76a5e37]
./mkfs.btrfs[0x8048ef1]
======= Memory map: ========
......
a tiny patch could fix it.
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
mkfs.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
@@ -308,9 +308,9 @@ static char *parse_label(char *input)
int i;
int len = strlen(input);
- if (len > BTRFS_LABEL_SIZE) {
+ if (len >= BTRFS_LABEL_SIZE) {
fprintf(stderr, "Label %s is too long (max %d)\n", input,
- BTRFS_LABEL_SIZE);
+ BTRFS_LABEL_SIZE - 1);
exit(1);
}
for (i = 0; i < len; i++) {