This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gas/config/tc-tic4x.c: Let insn name full use its space and always zero terminated


On Mon, Nov 17, 2014 at 11:47:08PM +0800, Chen Gang wrote:
> strncpy() can not be sure of insn name must be zero terminated, so need
> set it explicitly.

OK.

> At present, insn name is only used in tic4x_insn_check() which only test
> insn name within 9 chars explicitly. So it is harmless to use full space
> of insn name for strncpy().

Not OK.  You missed noticing that md_assemble is called recursively
for parallel instructions, and does strcat (insn->name, "_").  So
space must be reserved.

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]