This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] TUI: Fix buffer overflow in tui_expand_tabs
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Doug Evans <dje at google dot com>
- Cc: anton at samba dot org, gdb-patches at sourceware dot org
- Date: Sat, 21 Mar 2015 10:53:12 +0200
- Subject: Re: [PATCH] TUI: Fix buffer overflow in tui_expand_tabs
- Authentication-results: sourceware.org; auth=none
- References: <20150317103009 dot 538f2b3d at kryten> <CADPb22RopLQRqa-Us4nvK5WU_usSUUm-db61JrYz73FJ4gC73A at mail dot gmail dot com> <838uesw0xp dot fsf at gnu dot org> <21772 dot 18854 dot 130306 dot 303139 at ruffy2 dot mtv dot corp dot google dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Doug Evans <dje@google.com>
> Date: Fri, 20 Mar 2015 09:24:06 -0700
> Cc: anton@samba.org,
> gdb-patches@sourceware.org
>
> Nit. To my eyes the following would be more readable.
>
> - int n_adjust;
> + int nc, n_adjust;
> const char *s;
> char *ret, *q;
>
> /* 1. How many additional characters do we need? */
> - for (n_adjust = 0, s = string; s; )
> + for (nc = col, n_adjust = 0, s = string; s; )
Thanks, pushed with that change (master and gdb-7.9-branch).