This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix uninitialized use of variables.
- From: Jim Blandy <jimb at codesourcery dot com>
- To: Carlos O'Donell <carlos at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, Daniel Jacobowitz <dan at codesourcery dot com>
- Date: Tue, 23 Oct 2007 16:20:12 -0700
- Subject: Re: [PATCH] Fix uninitialized use of variables.
- References: <20071020172137.GC28823@lios>
Carlos O'Donell <carlos at codesourcery.com> writes:
> Index: gdb/remote.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/remote.c,v
> retrieving revision 1.271
> diff -u -p -r1.271 remote.c
> --- gdb/remote.c 8 Oct 2007 12:55:09 -0000 1.271
> +++ gdb/remote.c 18 Oct 2007 16:34:05 -0000
> @@ -1343,7 +1343,8 @@ unpack_varlen_hex (char *buff, /* packet
> static char *
> unpack_nibble (char *buf, int *val)
> {
> - ishex (*buf++, val);
> + if (!ishex (*buf++, val))
> + error (_("Unpacked nibble does not contain hex characters."));
> return buf;
> }
This looks fine to me, although Daniel has thoughts on error handling
in the remote protocol that I don't fully understand.
But the error message is going to be obscure to users. It should at
least say something about the remote protocol packet being misformed.