summaryrefslogtreecommitdiff
path: root/trust/pem.c
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2019-01-11 10:35:16 +0100
committerDaiki Ueno <ueno@gnu.org>2019-01-11 11:28:19 +0100
commitf277a1469aef05d3542e8ae9fd3f5dbadbe12463 (patch)
tree9feafbb9e440a08608c162eebfc65d1e87d228d3 /trust/pem.c
parentbebf4f3442ea5cdaa3a9fa2d0fee366e7264a227 (diff)
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
Diffstat (limited to 'trust/pem.c')
-rw-r--r--trust/pem.c2
1 files changed, 1 insertions, 1 deletions
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);
}