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/bio.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/bio.c')
-rw-r--r-- | src/util/bio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/bio.c b/src/util/bio.c index 522c28cf8..3de96bb4d 100644 --- a/src/util/bio.c +++ b/src/util/bio.c | |||
@@ -155,7 +155,7 @@ GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, | |||
155 | { | 155 | { |
156 | if (min > len - pos) | 156 | if (min > len - pos) |
157 | min = len - pos; | 157 | min = len - pos; |
158 | memcpy (&dst[pos], &h->buffer[h->pos], min); | 158 | GNUNET_memcpy (&dst[pos], &h->buffer[h->pos], min); |
159 | h->pos += min; | 159 | h->pos += min; |
160 | pos += min; | 160 | pos += min; |
161 | } | 161 | } |
@@ -481,7 +481,7 @@ GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, | |||
481 | min = h->size - h->have; | 481 | min = h->size - h->have; |
482 | if (min > n - pos) | 482 | if (min > n - pos) |
483 | min = n - pos; | 483 | min = n - pos; |
484 | memcpy (&h->buffer[h->have], &src[pos], min); | 484 | GNUNET_memcpy (&h->buffer[h->have], &src[pos], min); |
485 | pos += min; | 485 | pos += min; |
486 | h->have += min; | 486 | h->have += min; |
487 | if (pos == n) | 487 | if (pos == n) |