Date: Wed, 27 Jan 2016 11:03:06 +0000 From: Ruslan Bukin <ruslan.bukin@cl.cam.ac.uk> To: Devin Teske <dteske@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r294893 - head/lib/libdpv Message-ID: <20160127110306.GA92213@bsdpad.com> In-Reply-To: <201601270621.u0R6LZPd030494@repo.freebsd.org> References: <201601270621.u0R6LZPd030494@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
I get this with GCC 5.2.0: /home/rb743/dev/freebsd-riscv/lib/libdpv/dialog_util.c:270:23: error: zero-length gnu_printf format string [-Werror=for mat-zero-length] sprintf(dargv[n++], ""); Ruslan On Wed, Jan 27, 2016 at 06:21:35AM +0000, Devin Teske wrote: > Author: dteske > Date: Wed Jan 27 06:21:35 2016 > New Revision: 294893 > URL: https://svnweb.freebsd.org/changeset/base/294893 > > Log: > Fix a crash if `-D' is used without `-t title' > > dialog(3)'s dlg_reallocate_gauge(), used both by dialog(3)'s dialog_gauge() > and dialog(1)'s `--gauge', will segmentation fault in strlen(3) if no title > is set for the widget. Reproducible with `dialog --gauge hi 6 20' (adding > `--title ""' is enough to prevent segmentation fault). > > MFC after: 3 days > X-MFC-to: stable/10 > > Modified: > head/lib/libdpv/dialog_util.c > > Modified: head/lib/libdpv/dialog_util.c > ============================================================================== > --- head/lib/libdpv/dialog_util.c Wed Jan 27 06:16:53 2016 (r294892) > +++ head/lib/libdpv/dialog_util.c Wed Jan 27 06:21:35 2016 (r294893) > @@ -261,6 +261,13 @@ dialog_spawn_gauge(char *init_prompt, pi > errx(EXIT_FAILURE, "Out of memory?!"); > sprintf(dargv[n++], "--title"); > dargv[n++] = title; > + } else { > + if ((dargv[n] = malloc(8)) == NULL) > + errx(EXIT_FAILURE, "Out of memory?!"); > + sprintf(dargv[n++], "--title"); > + if ((dargv[n] = malloc(8)) == NULL) > + errx(EXIT_FAILURE, "Out of memory?!"); > + sprintf(dargv[n++], ""); > } > if (backtitle != NULL) { > if ((dargv[n] = malloc(12)) == NULL) >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160127110306.GA92213>