From f277a1469aef05d3542e8ae9fd3f5dbadbe12463 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 11 Jan 2019 10:35:16 +0100 Subject: pem: Fix assert condition If the PEM header is "-----BEGIN -----", *type should be an empty string and the parser shouldn't fail. Reported by Han Han in: https://bugzilla.redhat.com/show_bug.cgi?id=1665172 --- trust/pem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'trust/pem.c') diff --git a/trust/pem.c b/trust/pem.c index ce4f554..fae7dd6 100644 --- a/trust/pem.c +++ b/trust/pem.c @@ -84,7 +84,7 @@ pem_find_begin (const char *data, if (type) { pref += ARMOR_PREF_BEGIN_L; - assert (suff > pref); + assert (suff >= pref); *type = strndup (pref, suff - pref); return_val_if_fail (*type != NULL, NULL); } -- cgit v1.1