[Ocfs2-tools-devel] [PATCH] fix compiling error in mount.ocfs2.c
Joel Becker
Joel.Becker at oracle.com
Sun Apr 11 00:46:01 PDT 2010
On Sun, Apr 11, 2010 at 03:50:47PM +0800, Coly Li wrote:
> This patch fixes a compiling error in mount.ocfs2.
>
> Signed-off-by: Coly Li <coly.li at suse.de>
> ---
> mount.ocfs2/mount.ocfs2.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mount.ocfs2/mount.ocfs2.c b/mount.ocfs2/mount.ocfs2.c
> index f820a30..36e74ac 100644
> --- a/mount.ocfs2/mount.ocfs2.c
> +++ b/mount.ocfs2/mount.ocfs2.c
> @@ -261,7 +261,7 @@ int main(int argc, char **argv)
> char *extra = NULL;
> int dev_ro = 0;
> char *hbstr = NULL;
> - char stackstr[strlen(OCFS2_CLUSTER_STACK_ARG) + OCFS2_STACK_LABEL_LEN + 1] = "";
> + char stackstr[sizeof(OCFS2_CLUSTER_STACK_ARG) + OCFS2_STACK_LABEL_LEN] = "";
> ocfs2_filesys *fs = NULL;
> struct o2cb_cluster_desc cluster;
> struct o2cb_region_desc desc;
NAK, this is broken. Once you actually fill the thing, there
isn't enough room.
Joel
--
"The whole problem with the world is that fools and fanatics are always
so certain of themselves, and wiser people so full of doubts."
- Bertrand Russell
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
More information about the Ocfs2-tools-devel
mailing list