summaryrefslogtreecommitdiff
path: root/trust/pem.c
diff options
context:
space:
mode:
Diffstat (limited to 'trust/pem.c')
-rw-r--r--trust/pem.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/trust/pem.c b/trust/pem.c
index 7fe0076..ce4f554 100644
--- a/trust/pem.c
+++ b/trust/pem.c
@@ -85,10 +85,8 @@ pem_find_begin (const char *data,
if (type) {
pref += ARMOR_PREF_BEGIN_L;
assert (suff > pref);
- *type = malloc (suff - pref + 1);
+ *type = strndup (pref, suff - pref);
return_val_if_fail (*type != NULL, NULL);
- memcpy (*type, pref, suff - pref);
- (*type)[suff - pref] = 0;
}
/* The byte after this ---BEGIN--- */