Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/librefuse fuse_opt_parse() was using uninitialized struc...



details:   https://anonhg.NetBSD.org/src/rev/12e4eb5108f9
branches:  trunk
changeset: 762808:12e4eb5108f9
user:      soda <soda%NetBSD.org@localhost>
date:      Tue Mar 01 11:23:42 2011 +0000

description:
fuse_opt_parse() was using uninitialized struct fuse_opt_option::data,
this bug made fuse_opt_proc_t not work, if it used first ``data'' argument,
and might cause memory corruption even.

diffstat:

 lib/librefuse/refuse_opt.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r c46a68c41bdf -r 12e4eb5108f9 lib/librefuse/refuse_opt.c
--- a/lib/librefuse/refuse_opt.c        Tue Mar 01 10:54:06 2011 +0000
+++ b/lib/librefuse/refuse_opt.c        Tue Mar 01 11:23:42 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refuse_opt.c,v 1.14 2009/01/19 09:56:06 lukem Exp $    */
+/*     $NetBSD: refuse_opt.c,v 1.15 2011/03/01 11:23:42 soda Exp $     */
 
 /*-
  * Copyright (c) 2007 Juan Romero Pardines.
@@ -282,6 +282,7 @@
        if (!args || !args->argv || !args->argc || !proc)
                return 0;
 
+       foo.data = data;
        if (args->argc == 1)
                return proc(foo.data, *args->argv, FUSE_OPT_KEY_OPT, args);
 



Home | Main Index | Thread Index | Old Index