Motion-Project / motion

Motion, a software motion detector. Home page: https://motion-project.github.io/
GNU General Public License v2.0
3.69k stars 550 forks source link

Event id integer overflow #1780

Closed tosiara closed 4 months ago

tosiara commented 4 months ago

Did you read the guide?

Yes

What is the base version number of Motion being used?

4.6.x

What was the install method?

Built from source code

What is base architecture?

x86

What is the distro being used?

Ubuntu

Disto version number

20.04

Camera type(s) being used?

Network camera with HTTP

Describe the issue/problem and steps to reproduce

Event id (cnt->event_nr) is a signed integer and in case of an overflow it becomes a negative number.

Need to implement a check and reset the id gracefully if it is greater than 2147483647.

Motion log output at log_level 8

..

[1:ml1:motion] [NTC] [ALL] motion_detected: Motion detected - starting event -2147483648.