Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: strnlen?
From: Michael Davidsaver <mdavidsaver@gmail.com>
To: EPICS core-talk <core-talk@aps.anl.gov>
Date: Thu, 1 Dec 2016 18:32:45 -0500
Unless someone objects, I'm going to add epicsStrNLen() to epicsString.h
on the 3.14 branch [2] when I fix a seemingly broken nil test in
camessage.c [1].  I don't know if this can actually cause a crash, but
knowingly calling strlen() on a string which may be missing a nil seems
a recipe for problems at some point.

I'd rather use strlen() directly, but don't have time to fully
investigate portability right now.  RTEMS 4.9 has it, windows has it [3]
and the glibc needs POSIX-2008 compatibility [4].


[1]
https://github.com/epics-base/epics-base/blob/3.16/src/ioc/rsrv/camessage.c#L751

[2]
http://bazaar.launchpad.net/~epics-core/epics-base/caserver-id-plugin/revision/12518

[3] https://msdn.microsoft.com/en-us/library/z50ty2zh.aspx

[4] https://linux.die.net/man/3/strnlen

Replies:
Re: strnlen? Andrew Johnson

Navigate by Date:
Prev: Re: New OS_CLASS to epics-base Michael Davidsaver
Next: Re: strnlen? Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020 
Navigate by Thread:
Prev: Re: New OS_CLASS to epics-base Michael Davidsaver
Next: Re: strnlen? Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020 
ANJ, 01 Dec 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·