aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/syslog-ng/files/CVE-2022-38725-0008.patch
blob: 56c71e8a21de98fc8a8baa6bb64c22f462e9d3e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 56f881c5eaa3d8c02c96607c4b9e4eaf959a044d Mon Sep 17 00:00:00 2001
From: Laszlo Varady <laszlo.varady@protonmail.com>
Date: Sat, 20 Aug 2022 14:30:51 +0200
Subject: [PATCH 8/8/] timeutils: fix out-of-bounds reading of data buffer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

CVE: CVE-2022-38725

Upstream-Status: Backport
[https://github.com/syslog-ng/syslog-ng/commit/56f881c5eaa3d8c02c96607c4b9e4eaf959a044d]

Signed-off-by: László Várady <laszlo.varady@protonmail.com>

Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
---
 lib/timeutils/scan-timestamp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/timeutils/scan-timestamp.c b/lib/timeutils/scan-timestamp.c
index 125264677..c00d8e6a9 100644
--- a/lib/timeutils/scan-timestamp.c
+++ b/lib/timeutils/scan-timestamp.c
@@ -431,7 +431,7 @@ __parse_bsd_timestamp(const guchar **data, gint *length, WallClockTime *wct)
       if (!scan_pix_timestamp((const gchar **) &src, &left, wct))
         return FALSE;
 
-      if (*src == ':')
+      if (left && *src == ':')
         {
           src++;
           left--;
@@ -482,7 +482,7 @@ scan_rfc3164_timestamp(const guchar **data, gint *length, WallClockTime *wct)
    * looking at you, skip that as well, so we can reliably detect IPv6
    * addresses as hostnames, which would be using ":" as well. */
 
-  if (*src == ':')
+  if (left && *src == ':')
     {
       ++src;
       --left;
-- 
2.34.1