specifically to avoid walking off the end of the provided input
data, wasn't being used.
Possible ramification: libarchive could segfault when writing
shar files with uuencode encoding of file bodies, if the
data being read happened to end exactly at the end of
an allocated page.
SVN-Revision: 3375
static int
_uuencode_line(struct archive_write *a, struct shar *shar, const char *inbuf, size_t len)
{
- char tmp_buf[3], *buf;
+ char *buf;
size_t alloc_len;
/* len <= 45 -> expanded to 60 + len byte + new line */
buf += 4;
}
if (len != 0) {
+ char tmp_buf[3];
tmp_buf[0] = inbuf[0];
if (len == 1)
tmp_buf[1] = '\0';
else
tmp_buf[1] = inbuf[1];
tmp_buf[2] = '\0';
- uuencode_group(inbuf, buf);
+ uuencode_group(tmp_buf, buf);
buf += 4;
}
*buf++ = '\n';