1From 56f881c5eaa3d8c02c96607c4b9e4eaf959a044d Mon Sep 17 00:00:00 2001 2From: Laszlo Varady <laszlo.varady@protonmail.com> 3Date: Sat, 20 Aug 2022 14:30:51 +0200 4Subject: [PATCH 8/8/] timeutils: fix out-of-bounds reading of data buffer 5MIME-Version: 1.0 6Content-Type: text/plain; charset=UTF-8 7Content-Transfer-Encoding: 8bit 8 9CVE: CVE-2022-38725 10 11Upstream-Status: Backport 12[https://github.com/syslog-ng/syslog-ng/commit/56f881c5eaa3d8c02c96607c4b9e4eaf959a044d] 13 14Signed-off-by: László Várady <laszlo.varady@protonmail.com> 15 16Signed-off-by: Yogita Urade <yogita.urade@windriver.com> 17--- 18 lib/timeutils/scan-timestamp.c | 4 ++-- 19 1 file changed, 2 insertions(+), 2 deletions(-) 20 21diff --git a/lib/timeutils/scan-timestamp.c b/lib/timeutils/scan-timestamp.c 22index 125264677..c00d8e6a9 100644 23--- a/lib/timeutils/scan-timestamp.c 24+++ b/lib/timeutils/scan-timestamp.c 25@@ -431,7 +431,7 @@ __parse_bsd_timestamp(const guchar **data, gint *length, WallClockTime *wct) 26 if (!scan_pix_timestamp((const gchar **) &src, &left, wct)) 27 return FALSE; 28 29- if (*src == ':') 30+ if (left && *src == ':') 31 { 32 src++; 33 left--; 34@@ -482,7 +482,7 @@ scan_rfc3164_timestamp(const guchar **data, gint *length, WallClockTime *wct) 35 * looking at you, skip that as well, so we can reliably detect IPv6 36 * addresses as hostnames, which would be using ":" as well. */ 37 38- if (*src == ':') 39+ if (left && *src == ':') 40 { 41 ++src; 42 --left; 43-- 442.34.1 45 46