Module Name:    src
Committed By:   khorben
Date:           Sun Apr  9 23:03:51 UTC 2017

Modified Files:
        src/crypto/external/bsd/netpgp/dist/src/lib: signature.c

Log Message:
No longer hard-code the suffix length

This will avoid a buffer overflow if the suffix changes; it is currently
hard-coded as either "asc" or "sig".

Submitted on tech-pkg@ as:
[PATCH 10/11] No longer hard-code the suffix length


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 \
    src/crypto/external/bsd/netpgp/dist/src/lib/signature.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/signature.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/signature.c:1.36 src/crypto/external/bsd/netpgp/dist/src/lib/signature.c:1.37
--- src/crypto/external/bsd/netpgp/dist/src/lib/signature.c:1.36	Sun Apr  9 22:48:39 2017
+++ src/crypto/external/bsd/netpgp/dist/src/lib/signature.c	Sun Apr  9 23:03:50 2017
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: signature.c,v 1.36 2017/04/09 22:48:39 khorben Exp $");
+__RCSID("$NetBSD: signature.c,v 1.37 2017/04/09 23:03:50 khorben Exp $");
 #endif
 
 #include <sys/types.h>
@@ -909,7 +909,7 @@ open_output_file(pgp_output_t **output,
 			fd = pgp_setup_file_write(output, outname, overwrite);
 		}
 	} else {
-		size_t          flen = strlen(inname) + 4 + 1;
+		size_t          flen = strlen(inname) + 1 + strlen(suffix) + 1;
 		char           *f = NULL;
 
 		if ((f = calloc(1, flen)) == NULL) {

Reply via email to