File: nseceinval.diff

package info (click to toggle)
argus 2%3A5.0.2-3
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,576 kB
  • sloc: ansic: 41,305; sh: 3,757; lex: 466; makefile: 388; yacc: 371; perl: 178
file content (19 lines) | stat: -rw-r--r-- 807 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: correct EINVAL crash in argus
 caused by off-by-one in tv_nsec leading to invalid value
Author: Ming Fu <Ming.Fu@esentire.com>
Reviewed-by: Michael Stone <mstone@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: argus-5.0.2/argus/ArgusSource.c
===================================================================
--- argus-5.0.2.orig/argus/ArgusSource.c	2024-11-14 10:21:02.000000000 -0500
+++ argus-5.0.2/argus/ArgusSource.c	2025-04-18 11:58:29.942639837 -0400
@@ -4853,7 +4853,7 @@
 
          tts->tv_sec  = tvp->tv_sec + 0;
          tts->tv_nsec = (tvp->tv_usec * 1000) + 250000000;
-         if (tts->tv_nsec > 1000000000) {
+         if (tts->tv_nsec >= 1000000000) {
             tts->tv_sec++;
             tts->tv_nsec -= 1000000000;
          }