diff options
author | mandree <mandree@FreeBSD.org> | 2016-05-25 05:26:12 +0800 |
---|---|---|
committer | mandree <mandree@FreeBSD.org> | 2016-05-25 05:26:12 +0800 |
commit | e54737bd5d37ed0088f65b9a84636e687e49befd (patch) | |
tree | f3ad09d7bc5dd43aa924f6c914aa16922966ca5f /databases | |
parent | bf0412d55c37b60de53bc94febe98c05132af747 (diff) | |
download | freebsd-ports-graphics-e54737bd5d37ed0088f65b9a84636e687e49befd.tar.gz freebsd-ports-graphics-e54737bd5d37ed0088f65b9a84636e687e49befd.tar.zst freebsd-ports-graphics-e54737bd5d37ed0088f65b9a84636e687e49befd.zip |
Fix strncat() misuse, and enable TCL option.
PR: 209730
Submitted by: gahr@
Diffstat (limited to 'databases')
-rw-r--r-- | databases/db5/Makefile | 11 | ||||
-rw-r--r-- | databases/db5/files/patch-lang_tcl_tcl__db.c | 30 | ||||
-rw-r--r-- | databases/db5/files/patch-lang_tcl_tcl__env.c | 44 | ||||
-rw-r--r-- | databases/db5/files/patch-lang_tcl_tcl__seq.c | 16 |
4 files changed, 96 insertions, 5 deletions
diff --git a/databases/db5/Makefile b/databases/db5/Makefile index c3cfebca417..63cc87b417d 100644 --- a/databases/db5/Makefile +++ b/databases/db5/Makefile @@ -32,8 +32,9 @@ PATCH_WRKSRC= ${WRKDIR}/${DISTNAME} USE_LDCONFIG= yes PLIST_SUB= BDBMAJ=${BDBMAJ} BDBVER=${BDBVER} MAKE_ARGS+= docdir=${DOCSDIR} +CFLAGS+= -Wall -Wextra -OPTIONS_DEFINE= CRYPTO L10N SQL JAVA DOCS +OPTIONS_DEFINE= CRYPTO L10N SQL JAVA DOCS TCL # WARNING: DO NOT ADD TCL TO OPTIONS: # On FreeBSD 10.3 this causes a heap of warnings of the following kind # and is deemed unsafe. @@ -60,10 +61,10 @@ JAVA_VARS= DBLIBS+=libdb_java JAVA_VERSION="1.6 1.7" JAVA_CONFIGURE_ENABLE= java JAVA_CPPFLAGS= -I"${JAVA_HOME}/include" JAVA_CONFIGURE_ENV= JAVAC="${JAVAC}" JAR="${JAR}" JAVA="${JAVA}" JAVACFLAGS="-Xlint:unchecked" -#TCL_CONFIGURE_ENABLE= tcl -#TCL_USES= tcl:85+ -#TCL_CONFIGURE_WITH= tcl=${TCL_LIBDIR} -#TCL_VARS= DBLIBS+=libdb_tcl +TCL_CONFIGURE_ENABLE= tcl +TCL_USES= tcl:85+ +TCL_CONFIGURE_WITH= tcl=${TCL_LIBDIR} +TCL_VARS= DBLIBS+=libdb_tcl DOCS_INSTALL_TARGET= install_docs .include <bsd.port.options.mk> diff --git a/databases/db5/files/patch-lang_tcl_tcl__db.c b/databases/db5/files/patch-lang_tcl_tcl__db.c new file mode 100644 index 00000000000..dbd2fb6e500 --- /dev/null +++ b/databases/db5/files/patch-lang_tcl_tcl__db.c @@ -0,0 +1,30 @@ +--- lang/tcl/tcl_db.c.orig 2013-09-09 15:35:07 UTC ++++ lang/tcl/tcl_db.c +@@ -3708,9 +3708,10 @@ tcl_DbGetFlags(interp, objc, objv, dbp) + for (i = 0; db_flags[i].flag != 0; i++) + if (LF_ISSET(db_flags[i].flag)) { + if (strlen(buf) > 0) +- (void)strncat(buf, " ", sizeof(buf)); +- (void)strncat( +- buf, db_flags[i].arg, sizeof(buf)); ++ (void)strncat(buf, " ", ++ sizeof(buf) - (strlen(buf) + 1)); ++ (void)strncat(buf, db_flags[i].arg, ++ sizeof(buf) - (strlen(buf) + 1)); + } + + res = NewStringObj(buf, strlen(buf)); +@@ -3764,9 +3765,10 @@ tcl_DbGetOpenFlags(interp, objc, objv, d + for (i = 0; open_flags[i].flag != 0; i++) + if (LF_ISSET(open_flags[i].flag)) { + if (strlen(buf) > 0) +- (void)strncat(buf, " ", sizeof(buf)); +- (void)strncat( +- buf, open_flags[i].arg, sizeof(buf)); ++ (void)strncat(buf, " ", ++ sizeof(buf) - (strlen(buf) + 1)); ++ (void)strncat(buf, open_flags[i].arg, ++ sizeof(buf) - (strlen(buf) + 1)); + } + + res = NewStringObj(buf, strlen(buf)); diff --git a/databases/db5/files/patch-lang_tcl_tcl__env.c b/databases/db5/files/patch-lang_tcl_tcl__env.c new file mode 100644 index 00000000000..b923a521c0c --- /dev/null +++ b/databases/db5/files/patch-lang_tcl_tcl__env.c @@ -0,0 +1,44 @@ +--- lang/tcl/tcl_env.c.orig 2016-05-24 08:19:08 UTC ++++ lang/tcl/tcl_env.c +@@ -2864,9 +2864,10 @@ env_GetFlags(interp, objc, objv, dbenv) + for (i = 0; open_flags[i].flag != 0; i++) + if (LF_ISSET(open_flags[i].flag)) { + if (strlen(buf) > 0) +- (void)strncat(buf, " ", sizeof(buf)); +- (void)strncat( +- buf, open_flags[i].arg, sizeof(buf)); ++ (void)strncat(buf, " ", ++ sizeof(buf) - (strlen(buf) + 1)); ++ (void)strncat(buf, open_flags[i].arg, ++ sizeof(buf) - (strlen(buf) + 1)); + } + + res = NewStringObj(buf, strlen(buf)); +@@ -2930,9 +2931,10 @@ env_GetOpenFlag(interp, objc, objv, dben + for (i = 0; open_flags[i].flag != 0; i++) + if (LF_ISSET(open_flags[i].flag)) { + if (strlen(buf) > 0) +- (void)strncat(buf, " ", sizeof(buf)); +- (void)strncat( +- buf, open_flags[i].arg, sizeof(buf)); ++ (void)strncat(buf, " ", ++ sizeof(buf) - (strlen(buf) + 1)); ++ (void)strncat(buf, open_flags[i].arg, ++ sizeof(buf) - (strlen(buf) + 1)); + } + + res = NewStringObj(buf, strlen(buf)); +@@ -2982,9 +2984,10 @@ tcl_EnvGetEncryptFlags(interp, objc, obj + for (i = 0; encrypt_flags[i].flag != 0; i++) + if (LF_ISSET(encrypt_flags[i].flag)) { + if (strlen(buf) > 0) +- (void)strncat(buf, " ", sizeof(buf)); +- (void)strncat( +- buf, encrypt_flags[i].arg, sizeof(buf)); ++ (void)strncat(buf, " ", ++ sizeof(buf) - (strlen(buf) + 1)); ++ (void)strncat(buf, encrypt_flags[i].arg, ++ sizeof(buf) - (strlen(buf) + 1)); + } + + res = NewStringObj(buf, strlen(buf)); diff --git a/databases/db5/files/patch-lang_tcl_tcl__seq.c b/databases/db5/files/patch-lang_tcl_tcl__seq.c new file mode 100644 index 00000000000..14bb378b718 --- /dev/null +++ b/databases/db5/files/patch-lang_tcl_tcl__seq.c @@ -0,0 +1,16 @@ +--- lang/tcl/tcl_seq.c.orig 2016-05-24 08:18:03 UTC ++++ lang/tcl/tcl_seq.c +@@ -555,9 +555,10 @@ tcl_SeqGetFlags(interp, objc, objv, seq) + for (i = 0; seq_flags[i].flag != 0; i++) + if (LF_ISSET(seq_flags[i].flag)) { + if (strlen(buf) > 0) +- (void)strncat(buf, " ", sizeof(buf)); +- (void)strncat( +- buf, seq_flags[i].arg, sizeof(buf)); ++ (void)strncat(buf, " ", ++ sizeof(buf) - (strlen(buf) + 1)); ++ (void)strncat(buf, seq_flags[i].arg, ++ sizeof(buf) - (strlen(buf) + 1)); + } + + res = NewStringObj(buf, strlen(buf)); |