diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-08 17:20:23 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-08 17:20:23 +0000 |
commit | d8c53b12a818ff7cf82d06a1a69c395bdef85ee6 (patch) | |
tree | 0ebb0db416c157fcfde51a941185819dd12d51fd /src/util/server_mst.c | |
parent | 5184c17d32a39c928c2a0fec3ee1ad098bbaa562 (diff) | |
download | gnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.tar.gz gnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.zip |
-avoid calling memcpy() with NULL argument, even if len is 0
Diffstat (limited to 'src/util/server_mst.c')
-rw-r--r-- | src/util/server_mst.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/server_mst.c b/src/util/server_mst.c index 0a686a079..41b2e8ed9 100644 --- a/src/util/server_mst.c +++ b/src/util/server_mst.c | |||
@@ -152,7 +152,7 @@ do_align: | |||
152 | delta = | 152 | delta = |
153 | GNUNET_MIN (sizeof (struct GNUNET_MessageHeader) - | 153 | GNUNET_MIN (sizeof (struct GNUNET_MessageHeader) - |
154 | (mst->pos - mst->off), size); | 154 | (mst->pos - mst->off), size); |
155 | memcpy (&ibuf[mst->pos], buf, delta); | 155 | GNUNET_memcpy (&ibuf[mst->pos], buf, delta); |
156 | mst->pos += delta; | 156 | mst->pos += delta; |
157 | buf += delta; | 157 | buf += delta; |
158 | size -= delta; | 158 | size -= delta; |
@@ -194,7 +194,7 @@ do_align: | |||
194 | { | 194 | { |
195 | delta = GNUNET_MIN (want - (mst->pos - mst->off), size); | 195 | delta = GNUNET_MIN (want - (mst->pos - mst->off), size); |
196 | GNUNET_assert (mst->pos + delta <= mst->curr_buf); | 196 | GNUNET_assert (mst->pos + delta <= mst->curr_buf); |
197 | memcpy (&ibuf[mst->pos], buf, delta); | 197 | GNUNET_memcpy (&ibuf[mst->pos], buf, delta); |
198 | mst->pos += delta; | 198 | mst->pos += delta; |
199 | buf += delta; | 199 | buf += delta; |
200 | size -= delta; | 200 | size -= delta; |
@@ -281,7 +281,7 @@ copy: | |||
281 | mst->curr_buf = size + mst->pos; | 281 | mst->curr_buf = size + mst->pos; |
282 | } | 282 | } |
283 | GNUNET_assert (size + mst->pos <= mst->curr_buf); | 283 | GNUNET_assert (size + mst->pos <= mst->curr_buf); |
284 | memcpy (&ibuf[mst->pos], buf, size); | 284 | GNUNET_memcpy (&ibuf[mst->pos], buf, size); |
285 | mst->pos += size; | 285 | mst->pos += size; |
286 | } | 286 | } |
287 | if (purge) | 287 | if (purge) |