Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: StreamDevice 2.5: off by one
From: Martin Konrad <konrad@ikp.tu-darmstadt.de>
To: Dirk Zimoch <dirk.zimoch@psi.ch>
Cc: tech-talk@aps.anl.gov
Date: Fri, 11 Nov 2011 10:05:15 +0100
Hi Dirk,
I found a bug in the way StreamDevice 2.5 handles the parameter array
(off-by-one error). The attached patch should fix this issue.

Cheers

Martin

-- 
Dipl. Phys. Martin Konrad
Technische Universität Darmstadt
Institut für Kernphysik
Schlossgartenstr. 9
64289 Darmstadt
Tel.: +49-6151-16-5121
Fax: +49-6151-16-4321
--- src/StreamProtocol.cc.orig	2011-11-11 10:01:10.617669247 +0100
+++ src/StreamProtocol.cc	2011-11-11 10:02:28.704391049 +0100
@@ -739,10 +739,10 @@
     if (line) variables->line = line;
     // get parameters from name
     memset(parameter, 0, sizeof(parameter));
-    int i;
+    unsigned int i;
     const char* nextparameter;
     parameter[0] = protocolname();
-    for (i = 0; i < 10; i++)
+    for (i = 0; i < sizeof(parameter) / sizeof(parameter[0]) - 1; i++)
     {
         debug("StreamProtocolParser::Protocol::Protocol $%d=\"%s\"\n",
             i, parameter[i]);

Navigate by Date:
Prev: Allen Bradley VME-AB1771, 6008-SV2R Szalata, Zenon M.
Next: 'Patch' tool for windows Josh Stein
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: RE: Allen Bradley VME-AB1771, 6008-SV2R Szalata, Zenon M.
Next: 'Patch' tool for windows Josh Stein
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·