]> git.ozlabs.org Git - ppp.git/commitdiff
pppd: Fix printing call in print_option()
authorVegard Nossum <vegard.nossum@oracle.com>
Wed, 13 Jun 2018 10:38:53 +0000 (12:38 +0200)
committerPaul Mackerras <paulus@ozlabs.org>
Sat, 23 Jun 2018 04:42:50 +0000 (14:42 +1000)
print_option() was in this case passing p/opt->addr2 as the format string
instead of the string to be printed (as a quoted string). That could lead
to a nasty crash.

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
pppd/options.c

index 6e38d43ee900b20a4d5069d4ff8c877dfb930c3f..482dce69e666467a5dc1feef08703b7a50802caf 100644 (file)
@@ -992,7 +992,7 @@ print_option(opt, mainopt, printer, arg)
                        p = (char *) opt->addr2;
                        if ((opt->flags & OPT_STATIC) == 0)
                                p = *(char **)p;
                        p = (char *) opt->addr2;
                        if ((opt->flags & OPT_STATIC) == 0)
                                p = *(char **)p;
-                       printer("%q", p);
+                       printer(arg, "%q", p);
                } else if (opt->flags & OPT_A2LIST) {
                        struct option_value *ovp;
 
                } else if (opt->flags & OPT_A2LIST) {
                        struct option_value *ovp;