Skip to content

Fix warnings#755

Open
sjaeckel wants to merge 8 commits intodevelopfrom
fix-warnings
Open

Fix warnings#755
sjaeckel wants to merge 8 commits intodevelopfrom
fix-warnings

Conversation

@sjaeckel
Copy link
Copy Markdown
Member

@sjaeckel sjaeckel commented May 4, 2026

Pulled out from #751

Copy link
Copy Markdown
Member Author

@sjaeckel sjaeckel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should modify our builds to catch the parts that we want to as well.

We already run ubsan in the meta builds, why aren't those things caught there?

Comment thread src/misc/pem/pem_ssh.c
}
XMEMCPY(cpy, buf, len);
s = cpy;
err = CRYPT_ERROR;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? Shouldn't this instead return CRYPT_OK if len==0?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure as we do not accept zero len in ssh_read_authorized_keys

Comment thread src/misc/pem/pem_read.c
Comment on lines +51 to +55
char *w;
if (d == NULL || e == NULL)
return 0;
w = d + to_write;
if (w < d || w > e)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: I re-wrote this to the same form as before, since it is clearer and easier to understand IMO.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with that

@karel-m
Copy link
Copy Markdown
Member

karel-m commented May 5, 2026

Just FYI some options/flags I have used:

Sanitizers:

make clean
make -j$(nproc) CC=clang CFLAGS="-Wall -Wextra -I../libtommath -DUSE_LTM -DLTM_DESC -O1 -g3 -fno-omit-frame-pointer -fno-common -fsanitize=address,undefined -fsanitize-address-use-after-scope" LDFLAGS="-fsanitize=address,undefined" EXTRALIBS="-L../libtommath -ltommath" all
ASAN_OPTIONS=detect_leaks=1:abort_on_error=0:symbolize=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=0 ./test

Max compiler warnings:

make clean
make -j$(nproc) CC=clang CFLAGS="-Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-variable-declarations -Wshadow -Wformat=2 -Wno-format-nonliteral -Wunreachable-code -Wbad-function-cast -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wformat-security -Wreturn-type -Wincompatible-pointer-types -Wimplicit-function-declaration -Wint-conversion -Wfloat-conversion -Wstrict-overflow -Wvla -Walloca -Wnull-dereference -Wredundant-decls -Wnested-externs -Wdeclaration-after-statement -Wmissing-field-initializers -Wold-style-definition -I../libtommath -DUSE_LTM -DLTM_DESC -O2" EXTRALIBS="-L../libtommath -ltommath" all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants