[Libreoffice-commits] core.git: rsc/source solenv/gbuild
Stephan Bergmann
sbergman at redhat.com
Fri Sep 18 06:15:54 PDT 2015
rsc/source/rscpp/cpp.h | 2 +-
rsc/source/rscpp/cpp6.c | 2 +-
solenv/gbuild/platform/com_MSC_defs.mk | 3 +++
3 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 7a77d77effdace1b234062dd7bb035026c893a8b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Sep 18 11:16:54 2015 +0200
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 at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/rsc/source/rscpp/cpp.h b/rsc/source/rscpp/cpp.h
index 1f88f7b..d0432ed 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 74340dd..3678caa 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;
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index ab67e64..be9d923 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -81,6 +81,8 @@ gb_AFLAGS := $(AFLAGS)
# C4189: 'identifier' : local variable is initialized but not referenced
+# C4200: nonstandard extension used : zero-sized array in struct/union
+
# C4201: nonstandard extension used : nameless struct/union
# C4242: 'identifier' : conversion from 'type1' to 'type2', possible
@@ -150,6 +152,7 @@ gb_CFLAGS := \
$(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4100) \
-wd4127 \
$(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4189) \
+ -wd4200 \
-wd4242 \
-wd4244 \
-wd4251 \
More information about the Libreoffice-commits
mailing list