Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/asan_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
- name: Run autotools / configure
run: ./autogen.sh --enable-debug
- name: Compile and link (make)
run: make -j8 CFLAGS="-Werror -Wall -fsanitize=address" LDFLAGS="-fsanitize=address"
run: make -j8 CFLAGS="-Werror -Wall -Wextra -Wno-sign-compare -fsanitize=address" LDFLAGS="-fsanitize=address"
- name: Run unit tests
run: make -C tests/unit CFLAGS="-fsanitize=address" LDFLAGS="-fsanitize=address" check
2 changes: 1 addition & 1 deletion .github/workflows/macos_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
run: >
./autogen.sh --enable-debug
- name: Compile and link
run: MACOSX_DEPLOYMENT_TARGET=15.4 make -j8 CFLAGS="-Werror -Wall"
run: MACOSX_DEPLOYMENT_TARGET=15.4 make -j8 CFLAGS="-Werror -Wall -Wextra -Wno-sign-compare"
- name: Run unit tests
run: make -C tests/unit check
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
- name: Run autotools / configure
run: ./autogen.sh --enable-debug
- name: Compile and link (make)
run: make -j8 CFLAGS="-Werror -Wall"
run: make -j8 CFLAGS="-Werror -Wall -Wextra -Wno-sign-compare"
- name: Run unit tests
run: make -C tests/unit check
4 changes: 2 additions & 2 deletions cf-serverd/server_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ bool ServerTLSPeek(ConnectionInfo *conn_info)

const int peek_size = CF_INBAND_OFFSET + sizeof("CAUTH");

char buf[peek_size];
ssize_t got = recv(ConnectionInfoSocket(conn_info), buf, sizeof(buf), MSG_PEEK);
char *buf = alloca(peek_size);
ssize_t got = recv(ConnectionInfoSocket(conn_info), buf, peek_size, MSG_PEEK);
assert(got <= peek_size);
if (got < 0)
{
Expand Down
5 changes: 2 additions & 3 deletions libpromises/evalfunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -8533,9 +8533,8 @@ static FnCallResult FnCallClassFilterCsv(EvalContext *ctx,
}
else
{
size_t const key_len = PRINTSIZE(size_t);
char key[key_len];
xsnprintf(key, key_len, "%zu", i);
char key[PRINTSIZE(size_t)];
xsnprintf(key, PRINTSIZE(size_t), "%zu", i);

JsonObjectAppendString(class_container,
key,
Expand Down
2 changes: 1 addition & 1 deletion libpromises/ornaments.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void PromiseBanner(EvalContext *ctx, const Promise *pp)
}

const size_t n = 2*CF_MAXFRAGMENT + 3;
char pretty_promise_name[n+1];
char *pretty_promise_name = alloca(n+1);
pretty_promise_name[0] = '\0';
StringAppendAbbreviatedPromise(pretty_promise_name, pp->promiser, n, CF_MAXFRAGMENT);
Log(LOG_LEVEL_VERBOSE, "P: Promiser/affected object: '%s'", pretty_promise_name);
Expand Down
5 changes: 3 additions & 2 deletions libpromises/syslog_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#include <cf3.defs.h>


#define RFC3164_LENGTH 1024
/*
* Set by cf-agent/cf-serverd from body agent/server control.
*/
Expand Down Expand Up @@ -112,8 +114,7 @@ void RemoteSysLog(int log_priority, const char *log_string)
}
else
{
const size_t rfc3164_len = 1024;
char message[rfc3164_len];
char message[RFC3164_LENGTH];
char timebuffer[26];
pid_t pid = getpid();

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/mock_package_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
static char AVAILABLE_PACKAGES_FILE_NAME[PATH_MAX];
static char INSTALLED_PACKAGES_FILE_NAME[PATH_MAX];

static const int MAX_PACKAGE_ENTRY_LENGTH = 256;
#define MAX_PACKAGE_ENTRY_LENGTH 256

#define DEFAULT_ARCHITECTURE "x666"

Expand Down
Loading