Skip to content

Sanitizer: Add in build environment support - #288

Open
mrdeep1 wants to merge 1 commit into
eclipse-tinydtls:mainfrom
mrdeep1:sanitizer
Open

mrdeep1 wants to merge 1 commit into
eclipse-tinydtls:mainfrom
mrdeep1:sanitizer

Conversation

@mrdeep1

@mrdeep1 mrdeep1 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

configure --enable-sanitizer
cmake -DENABLE_SANITIZER=ON

Addresses trivial issues raised by the ASan sanitizer.

Includes m4/ax_check_compile_flag.m4, which is a part of the pkg autoconf-archive which not all systems have.

Add sanitizer runs to CI.

@mrdeep1
mrdeep1 force-pushed the sanitizer branch 3 times, most recently from 2099a3c to f155acf Compare September 18, 2026 14:37
Comment thread ccm.c Outdated
#define CCM_FLAGS(A,M,L) (((A > 0) << 6) | (((M - 2)/2) << 3) | (L - 1))

#define MASK_L(_L) ((1 << 8 * _L) - 1)
#define MASK_L(_L) (((size_t)1 << (8 * _L)) - 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That was reported in issue #278

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the pointer. It needs to be uint64_t for m32 builds.

Comment thread hmac.c
dtls_hash_update(&ctx->data, key, klen);
dtls_hash_finalize(ctx->pad, &ctx->data);
} else
} else if (key)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure, but if key must be checked, then that must be above that, the other if branch is also using key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe the logic is, if klen is 0, key maybe NULL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ASan complained.

@mrdeep1

mrdeep1 commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Just updated to include m32 testing.

Comment thread configure.ac Outdated
fi

AC_ARG_ENABLE([sanitize],
[AS_HELP_STRING([--enable-sanitize],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be --enable-sanitizer.
For CMake and in the PR description, it is "sanitizer".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed - fixed.

configure --enable-sanitizer
cmake -DENABLE_SANITIZER=ON

Addresses trivial issues raised by the ASan sanitizer.

Includes m4/ax_check_compile_flag.m4, which is a part of the
pkg autoconf-archive which not all systems have.

Add sanitizer runs to CI.

Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>

@obgm obgm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

3 participants