summaryrefslogtreecommitdiff
path: root/rsc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-09-18 11:16:54 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-09-18 13:15:27 +0000
commit7a77d77effdace1b234062dd7bb035026c893a8b (patch)
treec1181f8167e21fb2a4760a739a4d0b0c4aeca111 /rsc
parent23d4d2f6ac5aa2ca94109e07421a1ed8330b85bd (diff)
Use a C99 flexible array member
...so the following strcpy does not cause a false abort under _FORTIFY_SOURCE=2 Change-Id: I395136f11020064766db76f87ed8f5b01c083c3a Reviewed-on: https://gerrit.libreoffice.org/18681 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'rsc')
-rw-r--r--rsc/source/rscpp/cpp.h2
-rw-r--r--rsc/source/rscpp/cpp6.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/rsc/source/rscpp/cpp.h b/rsc/source/rscpp/cpp.h
index 1f88f7bff819..d0432ed5ec14 100644
--- a/rsc/source/rscpp/cpp.h
+++ b/rsc/source/rscpp/cpp.h
@@ -162,7 +162,7 @@ typedef struct defbuf
char* repl; /* -> replacement */
int hash; /* Symbol table hash */
int nargs; /* For define(args) */
- char name[1]; /* #define name */
+ char name[]; /* #define name */
} DEFBUF;
/*
diff --git a/rsc/source/rscpp/cpp6.c b/rsc/source/rscpp/cpp6.c
index 74340ddc2b38..3678caa65378 100644
--- a/rsc/source/rscpp/cpp6.c
+++ b/rsc/source/rscpp/cpp6.c
@@ -613,7 +613,7 @@ DEFBUF* defendel(char* name, int delete)
}
if (!delete)
{
- dp = (DEFBUF*) getmem(sizeof (DEFBUF) + size);
+ dp = (DEFBUF*) getmem(sizeof (DEFBUF) + size + 1);
dp->link = *prevp;
*prevp = dp;
dp->hash = nhash;