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

Potential security issue in src/input/shadow.c: Arithmetic Overflow in Expression #365

Open
monocle-ai opened this issue May 18, 2020 · 0 comments

Comments

@monocle-ai
Copy link

What is a Arithmetic Overflow? When a narrow type integral value was shifted left, multiplied, added, or subtracted and the result of that arithmetic operation was cast to a wider type value. If the operation overflowed the narrow type value, then data is lost. You can prevent this loss by converting the value to a wider type before the arithmetic operation.

1 instance of this defect were found in the following locations:

Instance 1
File : src/input/shadow.c

ZD.zaphit = ((uint64)linets + (xs + 16) * (PAL ? 15 : 16)) / 48 + timestampbase;

Code extract:

				sum = palo[a1].r + palo[a1].g + palo[a1].b;
				if (sum >= 100 * 3) {
					ZD.zaphit = ((uint64)linets + (xs + 16) * (PAL ? 15 : 16)) / 48 + timestampbase; <------ HERE
					goto endo;
				}
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