Hi The man pages say the name can be up to NAME_MAX characters, not including the null byte. So we need to have NAME_MAX + 1 bytes of storage.
- Lauri
>From ca2ffcf617d1a10d111195b1c1cadb94c5709c21 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen <[email protected]> Date: Tue, 9 Apr 2013 10:18:22 +0300 Subject: [PATCH] dirlisting: Fix off-by-one Signed-off-by: Lauri Kasanen <[email protected]> --- plugins/dirlisting/dirlisting.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/plugins/dirlisting/dirlisting.h b/plugins/dirlisting/dirlisting.h index f6edd53..319cb5b 100644 --- a/plugins/dirlisting/dirlisting.h +++ b/plugins/dirlisting/dirlisting.h @@ -64,7 +64,7 @@ struct mk_f_list { char ft_modif[MK_DIRHTML_FMOD_LEN]; struct file_info info; - char name[NAME_MAX]; + char name[NAME_MAX + 1]; /* The name can be up to NAME_MAX long; include NULL. */ char *size; struct mk_f_list *next; unsigned char type; -- 1.7.2.1
_______________________________________________ Monkey mailing list [email protected] http://lists.monkey-project.com/listinfo/monkey
