summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlosmn@github.com>2016-02-11 22:16:34 +0100
committerCarlos Martín Nieto <carlosmn@github.com>2016-02-11 22:16:34 +0100
commit66ce08a66ccc955a2214829448bea359dcb38a87 (patch)
tree9652b5edd7f15f12f7ae37438327d99ebdc8d5e5
parent488e2b85053a45dd2ce6a37b7d5cf70870be5ed8 (diff)
parent50174ab459e7a6c007f6ffa15d381f2f18bd89b8 (diff)
downloadlibgit2-66ce08a66ccc955a2214829448bea359dcb38a87.tar.gz
Merge pull request #3607 from pks-t/pks/coverity-improvements
Coverity improvements for GITERR_CHECK_ALLOC
-rwxr-xr-xscript/coverity.sh5
-rw-r--r--script/user_nodefs.h8
2 files changed, 11 insertions, 2 deletions
diff --git a/script/coverity.sh b/script/coverity.sh
index dcfeffc1d..8c826892f 100755
--- a/script/coverity.sh
+++ b/script/coverity.sh
@@ -33,6 +33,8 @@ if [ ! -d "$TOOL_BASE" ]; then
ln -s "$TOOL_DIR" "$TOOL_BASE"/cov-analysis
fi
+cp script/user_nodefs.h "$TOOL_BASE"/cov-analysis/config/user_nodefs.h
+
COV_BUILD="$TOOL_BASE/cov-analysis/bin/cov-build"
# Configure and build
@@ -48,10 +50,9 @@ COVERITY_UNSUPPORTED=1 \
tar czf libgit2.tgz cov-int
SHA=$(git rev-parse --short HEAD)
curl \
- --form project=libgit2 \
--form token="$COVERITY_TOKEN" \
--form email=bs@github.com \
--form file=@libgit2.tgz \
--form version="$SHA" \
--form description="Travis build" \
- http://scan5.coverity.com/cgi-bin/upload.py
+ https://scan.coverity.com/builds?project=libgit2
diff --git a/script/user_nodefs.h b/script/user_nodefs.h
new file mode 100644
index 000000000..110f76851
--- /dev/null
+++ b/script/user_nodefs.h
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) the libgit2 contributors. All rights reserved.
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+
+#nodef GITERR_CHECK_ALLOC(ptr) if (ptr == NULL) { __coverity_panic__(); }