[ovs-dev] [strings 0/3] Improve string-handling safety

Ben Pfaff blp at nicira.com
Tue Feb 22 19:09:55 UTC 2011


I was assuming that Justin would want to take a look, since it's
essentially a counterproposal to some of his patches from the coverity
series.

On Tue, Feb 22, 2011 at 11:04:20AM -0800, Ethan Jackson wrote:
> I'll review this series.
> 
> Ethan
> 
> On Tue, Feb 22, 2011 at 11:01 AM, Ben Pfaff <blp at nicira.com> wrote:
> > This series of patches improves the safety of string handling in
> > Open vSwitch.  I don't think that it actually fixes any real bugs,
> > but it removes all references to strncpy() from the source code,
> > which makes people and static checkers happier.
> >
> > Ben Pfaff (3):
> >  string: Implement strnlen() if it is missing.
> >  util: Don't read over 'size - 1' bytes of source string in
> >    ovs_strlcpy().
> >  util: New function ovs_strzcpy().
> >
> >  configure.ac               |    2 +-
> >  lib/automake.mk            |    1 +
> >  lib/netdev-linux.c         |   16 ++++++++--------
> >  lib/ofp-print.c            |    3 +--
> >  lib/route-table.c          |    5 ++---
> >  lib/socket-util.c          |    3 +--
> >  lib/{string.h => string.c} |   26 ++++++++++----------------
> >  lib/string.h               |    8 +++++++-
> >  lib/util.c                 |   33 ++++++++++++++++++++++++++++-----
> >  lib/util.h                 |    3 ++-
> >  10 files changed, 61 insertions(+), 39 deletions(-)
> >  copy lib/{string.h => string.c} (50%)
> >
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
> >




More information about the dev mailing list