Skip to content

Commit

Permalink
Merge pull request #672 from appneta/Bug_#670_gcc_9.3_compiler_warnings
Browse files Browse the repository at this point in the history
Bug #670: update Travis CI to focal
  • Loading branch information
fklassen authored Jun 19, 2021
2 parents 9f6f3d5 + 95a2ded commit dfc6353
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
sudo: required

os: linux
dist: focal
compiler: gcc
language: c


addons:
apt:
packages:
Expand All @@ -10,7 +13,7 @@ addons:
matrix:
include:
- os: linux
dist: trusty
dist: focal
compiler: gcc
addons:
apt:
Expand All @@ -19,18 +22,20 @@ matrix:
- autogen
- os: linux
dist: trusty
compiler: clang
env: CI_BUILD_PREFIX=scan-build-3.9
compiler: gcc
env: CI_BUILD_PREFIX=scan-build-9.3
addons:
apt:
packages:
- libpcap-dev
- clang-3.9
- autogen

before_script:
- git pull --tags

script:
- autoreconf -iv > build.log 2>&1 || (cat build.log && exit 1)
- ${CI_BUILD_PREFIX} ./configure --enable-local-libopts > build.log 2>&1 || (cat build.log && exit 1)
- ${CI_BUILD_PREFIX} ./configure --disable-local-libopts > build.log 2>&1 || (cat build.log && exit 1)
- ${CI_BUILD_PREFIX} make > build.log 2>&1 || (cat build.log && exit 1)
- make dist > build.log 2>&1 || (cat build.log && exit 1)
- sudo make test || (cat test/test.log && exit 1)
4 changes: 3 additions & 1 deletion docs/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
0r64/19/2021 Version 4.3.5-beta1
06/19/2021 Version 4.3.5-beta1
- gcc 9.3 compiler warnings #670
- heap-buffer-overflow with flow_decode() #665

04/01/2021 Version 4.3.4
- ASAN reports memory leaks while running tests (#662)
Expand Down
10 changes: 4 additions & 6 deletions src/common/cidr.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,18 @@ u_char *
ip2cidr(const unsigned long ip, const int masklen)
{
u_char *network;
char mask[3];
char mask[32];

network = (u_char *)safe_malloc(20);

strlcpy((char *)network, (char *)get_addr2name4(ip, RESOLVE), 20);

strcat((char *)network, "/");
if (masklen < 10) {
snprintf(mask, sizeof(mask), "%d", masklen);
snprintf(mask, sizeof(mask), "%d", masklen);
if (masklen < 10)
strncat((char *)network, mask, 1);
} else {
snprintf(mask, sizeof(mask), "%d", masklen);
else
strncat((char *)network, mask, 2);
}

return (network);
}
Expand Down

0 comments on commit dfc6353

Please sign in to comment.