EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: [Merge] ~info-martin-konrad/epics-base:backport-fix-for-lp1776141 into epics-base:3.15
From: Martin Konrad via Core-talk <core-talk at aps.anl.gov>
To: mp+393873 at code.launchpad.net
Date: Mon, 16 Nov 2020 19:35:35 -0000
Martin Konrad has proposed merging ~info-martin-konrad/epics-base:backport-fix-for-lp1776141 into epics-base:3.15.

Requested reviews:
  Andrew Johnson (anj)
Related bugs:
  Bug #1776141 in EPICS Base: "Buffer overrun in dbpr with long INP field"
  https://bugs.launchpad.net/epics-base/+bug/1776141

For more details, see:
https://code.launchpad.net/~info-martin-konrad/epics-base/+git/epics-base/+merge/393873

Backported 6761726e956e2add0558a8a8814253c7bc10a86b from 7.0 branch. Fixes LP #1776141.
-- 
Your team EPICS Core Developers is subscribed to branch epics-base:3.15.
diff --git a/src/ioc/db/dbTest.c b/src/ioc/db/dbTest.c
index 7f4f77b..f63e671 100644
--- a/src/ioc/db/dbTest.c
+++ b/src/ioc/db/dbTest.c
@@ -41,12 +41,13 @@
 #include "special.h"
 
 #define MAXLINE 80
+#define MAXMESS 128
 struct msgBuff {    /* line output structure */
     char            out_buff[MAXLINE + 1];
     char           *pNext;
     char           *pLast;
     char           *pNexTab;
-    char            message[128];
+    char            message[MAXMESS];
 };
 typedef struct msgBuff TAB_BUFFER;
 
@@ -1205,7 +1206,7 @@ static int dbpr_report(
                     sprintf(pmsg,"%s: Illegal Link Type", pfield_name);
                 }
                 else {
-                    sprintf(pmsg,"%s:%s %s", pfield_name,
+                    epicsSnprintf(pmsg, MAXMESS, "%s:%s %s", pfield_name,
                         pamaplinkType[ind].strvalue,dbGetString(pdbentry));
                 }
                 dbpr_msgOut(pMsgBuff, tab_size);

Replies:
[Merge] ~info-martin-konrad/epics-base:backport-fix-for-lp1776141 into epics-base:3.15 noreply--- via Core-talk

Navigate by Date:
Prev: [Bug 1776141] Re: Buffer overrun in dbpr with long INP field Martin Konrad via Core-talk
Next: Problems with hanging osiSockTest Zimoch Dirk (PSI) via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: [Bug 1776141] Re: Buffer overrun in dbpr with long INP field Martin Konrad via Core-talk
Next: [Merge] ~info-martin-konrad/epics-base:backport-fix-for-lp1776141 into epics-base:3.15 noreply--- via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 18 Nov 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·