upstream commit

2*len -> use xreallocarray() ok djm
This commit is contained in:
deraadt@openbsd.org 2015-04-24 01:36:24 +00:00 committed by Damien Miller
parent 657a5fbc0d
commit 8ac2ffd7aa
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: uuencode.c,v 1.27 2013/05/17 00:13:14 djm Exp $ */ /* $OpenBSD: uuencode.c,v 1.28 2015/04/24 01:36:24 deraadt Exp $ */
/* /*
* Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2000 Markus Friedl. All rights reserved.
* *
@ -82,7 +82,7 @@ dump_base64(FILE *fp, const u_char *data, u_int len)
fprintf(fp, "dump_base64: len > 65536\n"); fprintf(fp, "dump_base64: len > 65536\n");
return; return;
} }
buf = xmalloc(2*len); buf = xreallocarray(NULL, 2, len);
n = uuencode(data, len, buf, 2*len); n = uuencode(data, len, buf, 2*len);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
fprintf(fp, "%c", buf[i]); fprintf(fp, "%c", buf[i]);