This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit] objc-lang.c, classes_info, avoid string overrun
- From: Yao Qi <yao at codesourcery dot com>
- To: Michael Snyder <msnyder at vmware dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 01 Mar 2011 11:30:30 +0800
- Subject: Re: [commit] objc-lang.c, classes_info, avoid string overrun
- References: <4D6C4FDB.1030201@vmware.com>
On 03/01/2011 09:46 AM, Michael Snyder wrote:
> - if (sizeof (myregexp) < strlen (regexp) + 1)
> + if (sizeof (myregexp) < strlen (regexp) + 4)
> error (_("Regexp is too long: %s"), regexp);
> strcpy(myregexp, regexp);
It is a little bit confusing when people read this code. We may need a
short comment here.
--
Yao (éå)