pem: Ensure a value before checking Proc-Type in PEM header
authorTobias Brunner <tobias@strongswan.org>
Fri, 5 May 2017 07:01:51 +0000 (09:01 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 23 May 2017 16:29:12 +0000 (18:29 +0200)
src/libstrongswan/plugins/pem/pem_builder.c

index cda7037..ec90fb0 100644 (file)
@@ -250,7 +250,7 @@ static status_t pem_to_bin(chunk_t *blob, bool *pgp)
                                {
                                        continue;
                                }
-                               if (match("Proc-Type", &name) && *value.ptr == '4')
+                               if (match("Proc-Type", &name) && value.len && *value.ptr == '4')
                                {
                                        encrypted = TRUE;
                                }