* mailbox/mapfile_stream.c (_mapfile_write): Make sure
the size is not zero before making the memcpy().
Showing
2 changed files
with
21 additions
and
1 deletions
1 | 2001-07-04 Alain Magloire | ||
2 | |||
3 | * mailbox2/stream.c: stream_read() and stream_write() | ||
4 | change prototype to be "void *" instead of "char *". | ||
5 | * mailbox2/bstream.c: Adjust bstream_{read,write} to the | ||
6 | new prototypes. | ||
7 | * mailbox2/pop3/pop3_stream.c: Likewised. | ||
8 | * mailbox2/Makefile.am: New file. | ||
9 | * mailbox2/pop3/Makefile.am: New file. | ||
10 | * mailbox2/mstream.c: Mapfile stream Implementation. | ||
11 | * mailbox2/fstream.c: File stream implementation. | ||
12 | * mailbox2/include/mailutils/sys/fstream.h: New file. | ||
13 | * mailbox2/include/mailutils/sys/mstream.h: New file. | ||
14 | * mailbox2/tcp.c: rename to tcpstream.c. | ||
15 | * mailbox2/include/mailutils/sys/tcp.h: Rename to tcpstream.h | ||
16 | |||
17 | * mailbox/mapfile_stream.c (_mapfile_write): Make sure | ||
18 | the size is not zero before making the memcpy(). | ||
19 | |||
1 | 2001-07-03 Alain Magloire | 20 | 2001-07-03 Alain Magloire |
2 | 21 | ||
3 | * mail/headers.c: Catch the overflow in the calculation by | 22 | * 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, | ... | @@ -142,7 +142,8 @@ _mapfile_write (stream_t stream, const char *iptr, size_t isize, |
142 | mfs->size = offset + isize; | 142 | mfs->size = offset + isize; |
143 | } | 143 | } |
144 | 144 | ||
145 | memcpy (mfs->ptr + offset, iptr, isize); | 145 | if (isize) |
146 | memcpy (mfs->ptr + offset, iptr, isize); | ||
146 | if (nbytes) | 147 | if (nbytes) |
147 | *nbytes = isize; | 148 | *nbytes = isize; |
148 | return 0; | 149 | return 0; | ... | ... |
-
Please register or sign in to post a comment