summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/sign
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_install/sign')
-rw-r--r--usr.sbin/pkg_install/sign/sign.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/sign/sign.c b/usr.sbin/pkg_install/sign/sign.c
index ea1cf554971..48fed01aecd 100644
--- a/usr.sbin/pkg_install/sign/sign.c
+++ b/usr.sbin/pkg_install/sign/sign.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sign.c,v 1.3 1999/10/04 21:46:29 espie Exp $ */
+/* $OpenBSD: sign.c,v 1.4 2003/04/25 09:08:18 henning Exp $ */
/*-
* Copyright (c) 1999 Marc Espie.
*
@@ -114,13 +114,11 @@ sign(filename, type, userid, envp)
free_signature(sign);
return 0;
}
- copy = malloc(strlen(filename)+sizeof(COPY_TEMPLATE));
- if (copy == NULL) {
+ if (asprintf(&copy, COPY_TEMPLATE, filename) == -1) {
fprintf(stderr, "Can't allocate memory\n");
free_signature(sign);
return 0;
}
- sprintf(copy, COPY_TEMPLATE, filename);
result = embed_signature(filename, copy, sign);
if (result == 0) {
fprintf(stderr, "Can't embed signature in %s\n", filename);