EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: base/src/gdd/dbMapper.cc bug
From: [email protected]
To: [email protected]
Date: Wed, 20 Jan 1999 09:36:38 -0800 (PST)
Hello -

There is a bug in 3.13.1 base/src/gdd/dbMapper.cc where a 40 char string 
is copied into a string with space for only 26 chars (enums).  
The latest VMS C++ compiler complains about this - it was not causing
any apparent problem on my system.  It would be nice if it was fixed in
future versions.

This (and the copy in the opposite direction) is in four places:

			strncpy(&(db->strs[i][0]),str[i].fixed_string, 
				sizeof(aitFixedString));
			db->strs[i][sizeof(aitFixedString)-1u] = '\0';

I changed it to:
			strncpy(&(db->strs[i][0]),str[i].fixed_string, 
				MAX_ENUM_STRING_SIZE);
			db->strs[i][MAX_ENUM_STRING_SIZE-1u] = '\0';

since db is a dbr_gr_enum which sizes strings by MAX_ENUM_STRING_SIZE
which is 26 whereas sizeof(aitFixedString) is 40.

Stephanie Allison

Navigate by Date:
Prev: FW: comp.os.vxworks newsdigest Jeff Hill
Next: RE: alarm handler Jeff Hill
Index: 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: FW: comp.os.vxworks newsdigest Jeff Hill
Next: RE: base/src/gdd/dbMapper.cc bug Jeff Hill
Index: 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·