Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.9.28 - Leftshift of negative value #489

Open
TedLyngmo opened this issue Nov 8, 2023 · 0 comments
Open

v0.9.28 - Leftshift of negative value #489

TedLyngmo opened this issue Nov 8, 2023 · 0 comments

Comments

@TedLyngmo
Copy link

TedLyngmo commented Nov 8, 2023

asn_INTEGER2long() sets a long to -1 and leftshifts:

        long l;

        // ...

	if((*b >> 7)) l = -1; else l = 0;

	/* Conversion engine */
	for(; b < end; b++)
		l = (l << 8) | *b;

This means we can't turn on UBsan in our gate. This makes UBsan happy:

https://github.com/TedLyngmo/asn1c/tree/v0.9.28-maint-1

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

No branches or pull requests

1 participant