X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/blobdiff_plain/e9a17296ccbb7bb4f9a0affffe58d2240768a7d4..476861787f6e1b8a6c6af9307a15b9e57cb979dc:/openssh/uuencode.c?ds=sidebyside diff --git a/openssh/uuencode.c b/openssh/uuencode.c index 89fcb08..a139495 100644 --- a/openssh/uuencode.c +++ b/openssh/uuencode.c @@ -1,3 +1,4 @@ +/* $OpenBSD: uuencode.c,v 1.24 2006/08/03 03:34:42 deraadt Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -23,12 +24,17 @@ */ #include "includes.h" + +#include +#include +#include +#include + #include "xmalloc.h" #include "uuencode.h" -RCSID("$OpenBSD: uuencode.c,v 1.15 2002/03/04 17:27:39 stevesk Exp $"); int -uuencode(u_char *src, u_int srclength, +uuencode(const u_char *src, u_int srclength, char *target, size_t targsize) { return __b64_ntop(src, srclength, target, targsize); @@ -57,9 +63,14 @@ uudecode(const char *src, u_char *target, size_t targsize) void dump_base64(FILE *fp, u_char *data, u_int len) { - u_char *buf = xmalloc(2*len); + char *buf; int i, n; + if (len > 65536) { + fprintf(fp, "dump_base64: len > 65536\n"); + return; + } + buf = xmalloc(2*len); n = uuencode(data, len, buf, 2*len); for (i = 0; i < n; i++) { fprintf(fp, "%c", buf[i]);