summaryrefslogtreecommitdiff
path: root/soltools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-24 10:25:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-24 17:20:04 +0200
commit421c7d874d62f3d0f696df540744845753902583 (patch)
tree58a15698d5ad2cd9b80665038d4515bd2e32b2ed /soltools
parent672da0902b406c88042dfa3b48dd565700514343 (diff)
cid#1448523 silence bogus Out-of-bounds read
Change-Id: I0911133287ace66454e741f7ea994f191d06931c Reviewed-on: https://gerrit.libreoffice.org/76232 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'soltools')
-rw-r--r--soltools/cpp/_cpp.c1
-rw-r--r--soltools/cpp/_lex.c1
-rw-r--r--soltools/cpp/_macro.c7
-rw-r--r--soltools/cpp/_unix.c1
4 files changed, 10 insertions, 0 deletions
diff --git a/soltools/cpp/_cpp.c b/soltools/cpp/_cpp.c
index 0a7ce78d1749..003611c3f53b 100644
--- a/soltools/cpp/_cpp.c
+++ b/soltools/cpp/_cpp.c
@@ -74,6 +74,7 @@ void
{
trp->tp = trp->lp = trp->bp;
outptr = outbuf;
+ // coverity[overrun-buffer-arg: FALSE] - a multiple of trp->max is allocated, not trp->max itself
anymacros |= gettokens(trp, 1);
trp->tp = trp->bp;
}
diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c
index 0efd303d242e..dfd8605a3950 100644
--- a/soltools/cpp/_lex.c
+++ b/soltools/cpp/_lex.c
@@ -364,6 +364,7 @@ continue2:
{
trp->lp = tp;
tp = growtokenrow(trp);
+ // coverity[overrun-local : FALSE] - a multiple of trp->max is allocated, not trp->max itself
maxp = &trp->bp[trp->max];
}
tp->type = UNCLASS;
diff --git a/soltools/cpp/_macro.c b/soltools/cpp/_macro.c
index 8a89e9379d36..eaafb86034ef 100644
--- a/soltools/cpp/_macro.c
+++ b/soltools/cpp/_macro.c
@@ -287,7 +287,10 @@ void
if (np->flag & ISMAC)
builtin(trp, np->val);
else
+ {
+ // coverity[overrun-buffer-arg: FALSE] - a multiple of trp->max is allocated, not trp->max itself
expand(trp, np, &validators);
+ }
tp = trp->tp;
} // end for
if (flag)
@@ -430,7 +433,10 @@ int
while (parens > 0)
{
if (trp->tp >= trp->lp)
+ {
+ // coverity[overrun-buffer-arg: FALSE] - a multiple of trp->max is allocated, not trp->max itself
gettokens(trp, 0);
+ }
if (needspace)
{
needspace = 0;
@@ -602,6 +608,7 @@ void
tt[len] = '\0';
setsource("<##>", -1, -1, tt, 0);
maketokenrow(3, &ntr);
+ // coverity[overrun-buffer-arg: FALSE] - a multiple of trp->max is allocated, not trp->max itself
gettokens(&ntr, 1);
unsetsource();
if (ntr.bp->type == UNCLASS)
diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
index 2ee9215524a2..ac4b7624a00a 100644
--- a/soltools/cpp/_unix.c
+++ b/soltools/cpp/_unix.c
@@ -87,6 +87,7 @@ void
case 'A':
setsource("<cmdarg>", -1, -1, optarg, 0);
maketokenrow(3, &tr);
+ // coverity[overrun-buffer-arg: FALSE] - a multiple of trp->max is allocated, not trp->max itself
gettokens(&tr, 1);
doadefine(&tr, c);
dofree(tr.bp);