richardphibel / rpms / systemd

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