teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0254-basic-remove-an-assertion-from-cunescape_one.patch

b9a53a
From 43d72623fdfca8500c8c89a4b5023e35a3f0b259 Mon Sep 17 00:00:00 2001
b9a53a
From: Evgeny Vereshchagin <evvers@ya.ru>
b9a53a
Date: Fri, 16 Nov 2018 07:05:29 +0100
b9a53a
Subject: [PATCH] basic: remove an assertion from cunescape_one
b9a53a
b9a53a
The function takes a pointer to a random block of memory and
b9a53a
the length of that block. It shouldn't crash every time it sees
b9a53a
a zero byte at the beginning there.
b9a53a
b9a53a
This should help the dev-kmsg fuzzer to keep going.
b9a53a
b9a53a
(cherry picked from commit 8dc4de966ce6d32470aaff30ed054f6a2688d6d7)
b9a53a
b9a53a
Resolves: #1764560
b9a53a
---
b9a53a
 src/basic/escape.c | 1 -
b9a53a
 1 file changed, 1 deletion(-)
b9a53a
b9a53a
diff --git a/src/basic/escape.c b/src/basic/escape.c
b9a53a
index 5004763d97..5f715156fb 100644
b9a53a
--- a/src/basic/escape.c
b9a53a
+++ b/src/basic/escape.c
b9a53a
@@ -106,7 +106,6 @@ int cunescape_one(const char *p, size_t length, char32_t *ret, bool *eight_bit)
b9a53a
         int r = 1;
b9a53a
 
b9a53a
         assert(p);
b9a53a
-        assert(*p);
b9a53a
         assert(ret);
b9a53a
 
b9a53a
         /* Unescapes C style. Returns the unescaped character in ret.