Date: Sat, 1 May 2010 15:35:24 -0700 From: Alfred Perlstein <alfred@freebsd.org> To: hackers@freebsd.org Subject: Coverity warning: strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); Message-ID: <20100501223524.GU36233@elvis.mu.org>
next in thread | raw e-mail | index | archive | help
I notice this code sprinkled through the sources: strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); This trips up coverity because it does not know for sure that the string returned by cam_sim_name() is going to be DEV_IDLEN-1 characters long. Should we switch these calls to strlcpy? Is there a smarter thing to do to code more defensively? thank you, -- - Alfred Perlstein .- AMA, VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100501223524.GU36233>