projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69f8fad
)
check for integer overflow in buffer lib (fixes #6217)
author
Florian Dold
<florian.dold@gmail.com>
Fri, 24 Apr 2020 08:20:05 +0000
(13:50 +0530)
committer
Florian Dold
<florian.dold@gmail.com>
Fri, 24 Apr 2020 08:20:12 +0000
(13:50 +0530)
src/util/buffer.c
patch
|
blob
|
history
diff --git
a/src/util/buffer.c
b/src/util/buffer.c
index 8efb3e28451e87c5f8ca5563986476996c88c882..dabf630c7dab027c1189b93cbe7421ede7ce6b78 100644
(file)
--- a/
src/util/buffer.c
+++ b/
src/util/buffer.c
@@
-56,6
+56,8
@@
GNUNET_buffer_ensure_remaining (struct GNUNET_Buffer *buf,
{
size_t new_capacity = buf->position + n;
+ /* guard against overflow */
+ GNUNET_assert (new_capacity >= buf->position);
if (new_capacity <= buf->capacity)
return;
/* warn if calculation of expected size was wrong */