This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][AVR] fix unsafe uses of sprintf
"Denver Gingerich" <denver@ossguy.com> writes:
> diff -pur a/opcodes/avr-dis.c b/opcodes/avr-dis.c
> --- a/opcodes/avr-dis.c 2007-07-05 05:49:00.000000000 -0400
> +++ b/opcodes/avr-dis.c 2008-11-02 12:00:22.000000000 -0500
> @@ -109,7 +109,7 @@ avr_operand (unsigned int insn, unsigned
> case 0x100e: xyz = "-X"; break;
> default: xyz = "??"; ok = 0;
> }
> - sprintf (buf, xyz);
> + sprintf (buf, "%s", xyz);
Or strcpy.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."