diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-24 20:36:34 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-24 20:36:34 +0200 |
commit | 91fd7860cba14c27d52850f91b17060790855145 (patch) | |
tree | ed68970c3e78f18c06fc2a421e6d1468c74bffcf /src/util/buffer.c | |
parent | 18903294439021a77377bc63c74b284c82ad3894 (diff) | |
parent | 892bd3c6013f0a8c44106f16299a34d9a1c99e48 (diff) | |
download | gnunet-91fd7860cba14c27d52850f91b17060790855145.tar.gz gnunet-91fd7860cba14c27d52850f91b17060790855145.zip |
Merge branch 'master' of git+ssh://gnunet.org/gnunet
Diffstat (limited to 'src/util/buffer.c')
-rw-r--r-- | src/util/buffer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util/buffer.c b/src/util/buffer.c index 8efb3e284..dabf630c7 100644 --- a/src/util/buffer.c +++ b/src/util/buffer.c | |||
@@ -56,6 +56,8 @@ GNUNET_buffer_ensure_remaining (struct GNUNET_Buffer *buf, | |||
56 | { | 56 | { |
57 | size_t new_capacity = buf->position + n; | 57 | size_t new_capacity = buf->position + n; |
58 | 58 | ||
59 | /* guard against overflow */ | ||
60 | GNUNET_assert (new_capacity >= buf->position); | ||
59 | if (new_capacity <= buf->capacity) | 61 | if (new_capacity <= buf->capacity) |
60 | return; | 62 | return; |
61 | /* warn if calculation of expected size was wrong */ | 63 | /* warn if calculation of expected size was wrong */ |