
26 Jul
2011
26 Jul
'11
2 p.m.
Dear Laurence Withers,
In message 1310727678-30367-1-git-send-email-lwithers@guralp.com you wrote:
In miiphy_register() the new device's name was initialised by passing a string parameter as the format string to sprintf(). As this would cause problems if it ever contained a '%' symbol, switch to using strncpy() instead.
Signed-off-by: Laurence Withers lwithers@guralp.com Cc: Andy Fleming afleming@freescale.com
Changes for v2:
- Use strncpy() rather than plain strcpy() for extra safety.
Changes for v3:
- Use BUG_ON() as an additional safety measure to ensure the name never exceeds the buffer size MDIO_NAME_LEN, simplifying the previous test.
common/miiphyutil.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"Though a program be but three lines long,
someday it will have to be maintained."
- The Tao of Programming