summaryrefslogtreecommitdiff
path: root/uuencode.c
diff options
context:
space:
mode:
Diffstat (limited to 'uuencode.c')
-rw-r--r--uuencode.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/uuencode.c b/uuencode.c
index 0a7c8d16a..a13949585 100644
--- a/uuencode.c
+++ b/uuencode.c
@@ -1,3 +1,4 @@
1/* $OpenBSD: uuencode.c,v 1.24 2006/08/03 03:34:42 deraadt Exp $ */
1/* 2/*
2 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
3 * 4 *
@@ -23,7 +24,11 @@
23 */ 24 */
24 25
25#include "includes.h" 26#include "includes.h"
26RCSID("$OpenBSD: uuencode.c,v 1.17 2003/11/10 16:23:41 jakob Exp $"); 27
28#include <sys/types.h>
29#include <netinet/in.h>
30#include <resolv.h>
31#include <stdio.h>
27 32
28#include "xmalloc.h" 33#include "xmalloc.h"
29#include "uuencode.h" 34#include "uuencode.h"
@@ -58,9 +63,14 @@ uudecode(const char *src, u_char *target, size_t targsize)
58void 63void
59dump_base64(FILE *fp, u_char *data, u_int len) 64dump_base64(FILE *fp, u_char *data, u_int len)
60{ 65{
61 char *buf = xmalloc(2*len); 66 char *buf;
62 int i, n; 67 int i, n;
63 68
69 if (len > 65536) {
70 fprintf(fp, "dump_base64: len > 65536\n");
71 return;
72 }
73 buf = xmalloc(2*len);
64 n = uuencode(data, len, buf, 2*len); 74 n = uuencode(data, len, buf, 2*len);
65 for (i = 0; i < n; i++) { 75 for (i = 0; i < n; i++) {
66 fprintf(fp, "%c", buf[i]); 76 fprintf(fp, "%c", buf[i]);