Commit 8f5c34a2 8f5c34a2d69fd2de1877dec269421448573b82ef by Alain Magloire

* mailbox/mapfile_stream.c (_mapfile_write): Make sure

	the size is not zero before making the memcpy().
1 parent 594d8574
2001-07-04 Alain Magloire
* mailbox2/stream.c: stream_read() and stream_write()
change prototype to be "void *" instead of "char *".
* mailbox2/bstream.c: Adjust bstream_{read,write} to the
new prototypes.
* mailbox2/pop3/pop3_stream.c: Likewised.
* mailbox2/Makefile.am: New file.
* mailbox2/pop3/Makefile.am: New file.
* mailbox2/mstream.c: Mapfile stream Implementation.
* mailbox2/fstream.c: File stream implementation.
* mailbox2/include/mailutils/sys/fstream.h: New file.
* mailbox2/include/mailutils/sys/mstream.h: New file.
* mailbox2/tcp.c: rename to tcpstream.c.
* mailbox2/include/mailutils/sys/tcp.h: Rename to tcpstream.h
* mailbox/mapfile_stream.c (_mapfile_write): Make sure
the size is not zero before making the memcpy().
2001-07-03 Alain Magloire
* mail/headers.c: Catch the overflow in the calculation by
......
......@@ -142,7 +142,8 @@ _mapfile_write (stream_t stream, const char *iptr, size_t isize,
mfs->size = offset + isize;
}
memcpy (mfs->ptr + offset, iptr, isize);
if (isize)
memcpy (mfs->ptr + offset, iptr, isize);
if (nbytes)
*nbytes = isize;
return 0;
......