diff options
-rw-r--r-- | .travis.yml | 5 | ||||
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rwxr-xr-x | autogen.sh | 16 | ||||
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | model_file.c | 21 | ||||
-rw-r--r-- | src/ptunnel.c | 10 |
7 files changed, 44 insertions, 31 deletions
diff --git a/.travis.yml b/.travis.yml index 99d698e..18e1066 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,13 @@ before_install: after_failure: - cat config.log script: -- "./autogen.sh" +- ./autogen.sh - git clean -df . && dpkg-buildpackage -b -us -uc - git clean -df . && export CC=i686-w64-mingw32-gcc && ./autogen.sh --host=i686-w64-mingw32 --build=$(gcc -dumpmachine) env: global: - - secure: CN5K1QzTszUC/+U9m7cs2JJON/xUHf5umtAGQDrDCkr1o0y4+jbLv6LS5iBoJ3mG5mCeoVHfubg+2kk46+QiwgoRnENw59/aXotAELYZjkYDhi4KpZ/AjJ0sUiC2YlHE6pyC9PO/atMWGqATboP77EwbgYd+JAjblzh3FzKZ8GTavpaHDo8P96UE/YlmYewlHe2iqm36OyXhrOApqqa2hEDYmSXS8HIWhXszm0nwpdeee6ys8pC+ZHxSkPZ0u+N8pf71my25vqRGcpz7VWktv0FMfNvld9+dgw+SZBk9i9YALvJHkEdcBwAmlg9EoT8LsI3GPvuPI1C0sQPq5fT2POUa4DB59IiKbhRoajwFs7g+LiJvuW2VewWWf3K0eacyQ5/G5ATfzuCC83qo1mr3UwVSTwdpPdHumUV6DnR7JPbh1d2ZzzpG9rUpkB7Gg7DiR19w0DRyRq5FvaBmEdRudjBeySXmOE+MwxfBqZUgmNtd2rTaNKWj2XlGCHuyi5rUD2Y0cFaOOdqqwYEIDNEPpdOGoihHfGDFsvAg21h81peW/9p9CBmnXOH+8b/BnSeh0ibP0SXnPZMFUy8RaHBVnNTmOqDSym4uBB+KzJ5a/VGdO4O4SAwHF/PkQfqHQr5TNO4WaZd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lr7iVJ2Yc8/TFkFwaIMLMBE1UAyhgi8QBEJhdgXKp5a4B9Qouebnpp3w4znUrd037ZaVdfSruqqBl1QTYPYcUAYrKbPZIxGTQGJGHJbQw48sl4r/ssZj9NKnijfgZW3jxNJnvUPTuEFGnsdFqEwv5HxO4O3UWp5vrwX1sC+1+QrAsE+3fUmX4x1J39XOU9u0cAcBtnj88t9uRYndB3OhXqAp2hHNy7YQlDsnaNTvqIVt3W7na5HwjlZ320aFTRSdC/j/rd8O5CEgaCJK4GP2Gwcvffom4yOGt9+gO2aYSOosfkkjT5G6cdYOUr+fKR0ZUQ2uaw2njatswQ= addons: coverity_scan: project: @@ -1,6 +1,11 @@ PingTunnel-NG Changelog ======================= +1.30 - 19. October 2018 +- travis-ci, coverity integration +- xcompile issue for mingw-w64 fixed +- fixed wrong usage of format() specifiers + 1.20 - 15. July 2018 - Readme improvements - Fixes a possible memory leak when a packet could not send @@ -1,14 +1,14 @@ pkgname="ptunnel-ng" -pkgver=1.1 +pkgver=1.2 pkgrel=1 -pkgdesc="PingTunnel-NG binary for icmp/udp tunneling" +pkgdesc="A TCP forwarder and proxy used for ICMP/UDP tunneling without creating tun devices. (Ping Tunnel, ICMP Echo Tunnel, UDP Tunnel)" arch=('i686' 'x86_64') url='https://www.github.com/lnslbrty/ptunnel-ng' license=('BSD-3') makedepends=('git') provides=("ptunnel-ng=${pkgver}") source=("https://github.com/lnslbrty/ptunnel-ng/archive/v${pkgver}.tar.gz") -md5sums=('SKIP') +md5sums=('55ea297a34ae35ddc8d5586b15040a15') build() { cd "${srcdir}/${pkgname}-${pkgver}" @@ -1,16 +1,12 @@ #!/bin/bash -set -e set -x -OLDPWD=$(pwd) -cd $(dirname $0) -test -f Makefile && make distclean +if ! autoreconf -fi; then + aclocal + autoheader + automake --force-missing --add-missing + autoconf +fi -aclocal -autoheader -automake --force-missing --add-missing -autoconf - -cd ${OLDPWD} $(dirname $0)/configure $@ && make -j${BUILDJOBS:-4} all diff --git a/configure.ac b/configure.ac index a96a2fc..36ddddc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,20 +1,10 @@ AC_PREREQ(2.69) -AC_INIT([ptunnel-ng], [1.2], [], [], []) +AC_INIT([ptunnel-ng], [1.3], [], [], []) AC_CONFIG_SRCDIR([src/config.h.in]) AC_CONFIG_FILES([Makefile src/Makefile]) AC_CANONICAL_BUILD AC_CANONICAL_HOST -if test x"$cross_compiling" != x"no"; then - HOST_PREFIX="${host_alias}-" - HOST_SUFFIX="-$host_alias" - if test x"${build_alias}" = x; then - AC_MSG_ERROR([Cross compile enabled but no --build *explicitly* specified. For example: --build=$(gcc -dumpmachine)]) - fi -else - HOST_PREFIX= - HOST_SUFFIX= -fi case x"${host}" in x*-*-cygwin* | x*-*-mingw32*) dnl Some Windows includes required by third-party modules. diff --git a/model_file.c b/model_file.c new file mode 100644 index 0000000..2799fa8 --- /dev/null +++ b/model_file.c @@ -0,0 +1,21 @@ +/* Coverity Scan model + * + * This is a modeling file for Coverity Scan. Modeling helps to avoid false + * positives. + * + * - A model file can't import any header files. + * - Therefore only some built-in primitives like int, char and void are + * available but not wchar_t, NULL etc. + * - Modeling doesn't need full structs and typedefs. Rudimentary structs + * and similar types are sufficient. + * - An uninitialized local pointer is not an error. It signifies that the + * variable could be either NULL or have some data. + * + * Coverity Scan doesn't pick up modifications automatically. The model file + * must be uploaded by an admin in the analysis settings of + */ + +/* ignore optarg NULL deref false positive for parse_options(...) */ +int parse_options(int argc, char **argv) { + __coverity_panic__(); +} diff --git a/src/ptunnel.c b/src/ptunnel.c index 7ac7ecb..a4c5ae5 100644 --- a/src/ptunnel.c +++ b/src/ptunnel.c @@ -63,11 +63,13 @@ /** Local error string storage */ static char errorstr[255]; static char * print_last_windows_error() { + char last_errorstr[255]; DWORD last_error = GetLastError(); - memset(errorstr, 0, sizeof(errorstr)); + + memset(last_errorstr, 0, sizeof(last_errorstr)); FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, last_error, 0, errorstr, sizeof(errorstr), NULL); - snprintf(errorstr, sizeof(errorstr), "%s (%lu)", errorstr, last_error); + NULL, last_error, 0, last_errorstr, sizeof(last_errorstr), NULL); + snprintf(errorstr, sizeof(errorstr), "%s (%lu)", last_errorstr, last_error); return errorstr; } #define strerror(x) print_last_windows_error() @@ -702,7 +704,7 @@ void print_statistics(xfer_stats_t *xfer, int is_continuous) { if (is_continuous) printf("\r"); - printf("[inf]: I/O: %6.2f/%6.2f mb ICMP I/O/R: %8d/%8d/%8d Loss: %4.1f%%", + printf("[inf]: I/O: %6.2f/%6.2f mb ICMP I/O/R: %8u/%8u/%8u Loss: %4.1f%%", xfer->bytes_in/mb, xfer->bytes_out/mb, xfer->icmp_in, xfer->icmp_out, xfer->icmp_resent, loss); if (!is_continuous) |