diff options
author | Daiki Ueno <dueno@redhat.com> | 2019-01-11 10:35:16 +0100 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2019-01-11 11:28:19 +0100 |
commit | f277a1469aef05d3542e8ae9fd3f5dbadbe12463 (patch) | |
tree | 9feafbb9e440a08608c162eebfc65d1e87d228d3 /trust/pem.c | |
parent | bebf4f3442ea5cdaa3a9fa2d0fee366e7264a227 (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.c | 2 |
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); } |