static size_t iobuf_in_ndx;
size_t msg_bytes;
int tag, ret = 0;
-#if MAXPATHLEN < 4096
- char line[4096+1024];
-#else
- char line[MAXPATHLEN+1024];
-#endif
+ char line[BIGPATHBUFLEN];
if (!iobuf_in || fd != sock_f_in)
return read_timeout(fd, buf, len);
/* Write len bytes to the file descriptor fd, looping as necessary to get
- * the job done and also (in certain circumstnces) reading any data on
+ * the job done and also (in certain circumstances) reading any data on
* msg_fd_in to avoid deadlock.
*
* This function underlies the multiplexing system. The body of the
**/
static void mplex_write(enum msgcode code, char *buf, size_t len)
{
- char buffer[4096];
+ char buffer[BIGPATHBUFLEN];
size_t n = len;
SIVAL(buffer, 0, ((MPLEX_BASE + (int)code)<<24) + len);
void io_printf(int fd, const char *format, ...)
{
va_list ap;
- char buf[1024];
+ char buf[BIGPATHBUFLEN];
int len;
va_start(ap, format);
if (len < 0)
exit_cleanup(RERR_STREAMIO);
+ if (len > (int)sizeof buf) {
+ rprintf(FERROR, "io_printf() was too long for the buffer.\n");
+ exit_cleanup(RERR_STREAMIO);
+ }
+
write_sbuf(fd, buf);
}